summaryrefslogtreecommitdiff
path: root/index.rb
blob: 60b041a0037403cd4df9c34e5891372102fbed0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'erb'

@title = "Web log entries"
@copyright = "Luke Shumaker"
license = "CC BY-SA-3.0"
license_url = 'https://creativecommons.org/licenses/by-sa/3.0/'
@license="<a href=\"#{license_url}\">#{license}</a>"

@content = "<h1>#{@title}</h1>\n<ul>\n"
for filename in ARGV do
	title = File.read(filename).split("\n",2).first;
	url=filename.sub(/^public\//,'./').sub(/\.md$/,'');
	@content += "<li><tt><a href='#{url}.html'>#{url}</a></tt> — #{title}</a></li>\n"
end
@content += "</ul>\n"

template = 'template.erb'
erb = ERB.new(File.read(template));
erb.filename = template
erb.run()