all repos — h3rald @ 401d8e9a7cc09fd6c1aa19edc4d7ad6356c18800

The sources of https://h3rald.com

Minor changes.
h3rald h3rald@h3rald.com
Mon, 14 Jun 2010 11:39:27 +0200
commit

401d8e9a7cc09fd6c1aa19edc4d7ad6356c18800

parent

6f926b2becaeb0c09a2bb80c14cc61926dcc5d50

1 files changed, 22 insertions(+), 19 deletions(-)

jump to
M RulesRules

@@ -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