diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-09-10 13:17:26 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-12 22:47:59 +0200 |
commit | fb7d1f21c91201d44496333294ddd9a09dd86a09 (patch) | |
tree | 90b7d6a6a11a15899ab7ec75ae396f0a651a6273 /_plugins | |
parent | Kill nav3 from GLEPs (diff) | |
download | www-fb7d1f21c91201d44496333294ddd9a09dd86a09.tar.gz www-fb7d1f21c91201d44496333294ddd9a09dd86a09.tar.bz2 www-fb7d1f21c91201d44496333294ddd9a09dd86a09.zip |
Support rendering GLEPs into HTML
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/gleps.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/_plugins/gleps.rb b/_plugins/gleps.rb index 658fa62..59c8dd7 100644 --- a/_plugins/gleps.rb +++ b/_plugins/gleps.rb @@ -1,3 +1,5 @@ +require 'rbst' + module Gentoo class GLEPGenerator < Jekyll::Generator GLEP_DIR = '_data/glep/' @@ -30,11 +32,13 @@ module Gentoo read_yaml(File.join(@base, GLEPGenerator::GLEP_DIR), name) data['permalink'] = "/inside-gentoo/gleps/#{@name}" - data['layout'] = 'page-pre' + data['layout'] = 'page' data['nav1'] = 'inside-gentoo' data['nav2'] = 'gleps' - File.readlines(File.join(@base, GLEPGenerator::GLEP_DIR, name)).each do |line| + 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: (.*)$/ @@ -47,6 +51,7 @@ module Gentoo @posthistory = $1 if line =~ /^Post-History: (.*)$/ break if line.chomp.empty? end + @content = RbST.new(lines.join('')).to_html site.data['gleps'] << { 'number' => @number, |