summaryrefslogtreecommitdiff
path: root/pagerender.rb
diff options
context:
space:
mode:
Diffstat (limited to 'pagerender.rb')
-rwxr-xr-xpagerender.rb50
1 files changed, 0 insertions, 50 deletions
diff --git a/pagerender.rb b/pagerender.rb
deleted file mode 100755
index 3c122bc..0000000
--- a/pagerender.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-load 'pandoc.rb'
-load 'util.rb'
-require 'erb'
-require 'date'
-
-$license_urls = {
- "CC BY-SA-3.0" => 'https://creativecommons.org/licenses/by-sa/3.0/',
- 'WTFPL-2' => "http://www.wtfpl.net/txt/copying/",
-}
-$person_uris = {
- "Luke Shumaker" => "https://lukeshu.com/",
-}
-$person_emails = {
- "Luke Shumaker" => "lukeshu@sbcglobal.net",
-}
-
-template = "template.#{ARGV[0]}.erb"
-infile = ARGV[1]
-
-input = File.read(infile)
-doc = Pandoc::load('markdown', input)
-
-if doc['markdown_options']
- doc = Pandoc::load('markdown'+doc['markdown_options'], input)
-end
-
-gitdate = `git log -n1 --format='%cI' -- #{infile}`
-
-@title = doc['title'] || input.split("\n",2).first
-@author = Person.new(doc['author'] || "Luke Shumaker")
-@gitdate = DateTime.iso8601(gitdate) unless gitdate.empty?
-@date = Date.parse(doc['date']) unless doc['date'].nil?
-@license = License.new(doc['license'] || "CC BY-SA-3.0")
-@slug = infile.sub(/\..*$/,'').sub(/^.*\//,'')
-@content = doc.to('html5')
-@rights = "<p>The content of this page is Copyright © #{@date.year unless @date.nil?} #{@author.html}.</p>\n" +
- "<p>This page is licensed under the #{@license.html} license.</p>"
-
-@breadcrumbs = '<a href="/">Luke Shumaker</a> » '
-if (@slug == 'index')
- @breadcrumbs += "blog"
-else
- @breadcrumbs += '<a href=/blog>blog</a> » ' + @slug
-end
-
-erb = ERB.new(File.read(template));
-erb.filename = template
-erb.run()