diff options
Diffstat (limited to '_plugins/gleps.rb')
-rw-r--r-- | _plugins/gleps.rb | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/_plugins/gleps.rb b/_plugins/gleps.rb index 631e47c..62c7f78 100644 --- a/_plugins/gleps.rb +++ b/_plugins/gleps.rb @@ -17,7 +17,7 @@ module Gentoo end end - site.data['gleps'] = site.data['gleps'].sort { |a, b| a['number'] <=> b['number'] } + site.data['gleps'] = site.data['gleps'].sort { |a, b| a['GLEP'] <=> b['GLEP'] } end end @@ -31,53 +31,17 @@ module Gentoo process(@name) read_yaml(File.join(@base, GLEPGenerator::GLEP_DIR), name) + data['title'] = "GLEP #{data['GLEP']}: #{data['Title']}" data['permalink'] = "/glep/#{@name}" data['layout'] = 'glep' data['nav1'] = 'inside-gentoo' data['nav2'] = 'gleps' data['extracss'] = ['glep.css'] - lines = File.readlines(File.join(@base, GLEPGenerator::GLEP_DIR, name)) - while not lines.empty? - line = lines.shift - @number = $1.to_i if line =~ /^GLEP: (.*)$/ - @title = $1 if line =~ /^Title: (.*)$/ - @version = $1 if line =~ /^Version: (.*)$/ - @lastmodified = $1 if line =~ /^Last-Modified: (.*)$/ - @author = $1 if line =~ /^Author: (.*)$/ - @discussionsto = $1 if line =~ /^Discussions-To: (.*)$/ - @status = $1 if line =~ /^Status: (.*)$/ - @type = $1 if line =~ /^Type: (.*)$/ - @contenttype = $1 if line =~ /^Content-Type: (.*)$/ - @requires = $1 if line =~ /^Requires: (.*)$/ - @created = $1 if line =~ /^Created: (.*)$/ - @posthistory = $1 if line =~ /^Post-History: (.*)$/ - @replaces = $1 if line =~ /^Replaces: (.*)$/ - @replacedby = $1 if line =~ /^Replaced-By: (.*)$/ - break if line.chomp.empty? - end - @content = RbST.new(".. contents::\n..\n\n" + lines.join('')).to_html( + @content = RbST.new(".. contents::\n..\n\n" + @content).to_html( 'initial-header-level' => 2) - glep_data = { - 'number' => @number, - 'title' => @title, - 'version' => @version, - 'lastmodified' => @lastmodified, - 'author' => @author, - 'discussionsto' => @discussionsto, - 'status' => @status, - 'type' => @type, - 'contenttype' => @contenttype, - 'requires' => @requires, - 'created' => @created, - 'posthistory' => @posthistory, - 'replaces' => @replaces, - 'replacedby' => @replacedby, - } - - data.update(glep_data) - site.data['gleps'] << glep_data.merge({ + site.data['gleps'] << data.merge({ 'url' => data['permalink'] }) end |