Minor changes.
h3rald h3rald@h3rald.com
Mon, 14 Jun 2010 11:39:27 +0200
1 files changed,
22 insertions(+),
19 deletions(-)
jump to
M
Rules
→
Rules
@@ -50,31 +50,34 @@ when 'bbcode' then
rep.filter :bbcode layout 'default' when 'glyph' then + pdf_file = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.pdf" + unless pdf_file.exist? then # Create the PDF file - f = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.glyph" - f.parent.mkpath - doc = %{ + f = Pathname.new "#{Dir.pwd}/output#{item.identifier.gsub(/\/$/, '')}.glyph" + f.parent.mkpath + doc = %{ include[#{f.parent.parent.parent}/lib/data] h3rald_article[ @identifier[#{item.identifier}] @content[#{item.raw_content}] ] - } - # Write the new raw file using Glyph's file_write method - file_write f, doc - # Now compile the PDF (works if Prince is installed) - target = Glyph['document.output'] - Glyph['document.output'] = 'pdf' - Glyph['document.author'] = "Fabio Cevasco" - Glyph['site.root'] = ".." - Glyph['document.date'] = item[:date].strftime "%A, %d %B %Y" - Glyph['document.title'] = item[:title] - Glyph['document.subtitle'] = "" - Glyph.compile f.to_s - begin - #f.unlink - #Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink - rescue + } + # Write the new raw file using Glyph's file_write method + file_write f, doc + # Now compile the PDF (works if Prince is installed) + target = Glyph['document.output'] + Glyph['document.output'] = 'pdf' + Glyph['document.author'] = "Fabio Cevasco" + Glyph['site.root'] = ".." + Glyph['document.date'] = item[:date].strftime "%A, %d %B %Y" + Glyph['document.title'] = item[:title] + Glyph['document.subtitle'] = "" + Glyph.compile f.to_s + begin + f.unlink + Pathname.new(f.to_s.gsub(/\.glyph$/, '.html')).unlink + rescue + end end Glyph['site.root'] = "" # Filter text rep