From a5f4e1ed470b96c1f97f3827fe07d530c53f0e5c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 3 Jan 2017 20:57:36 -0500 Subject: I hate URL handling. --- bin/index | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin/index') diff --git a/bin/index b/bin/index index 2443380..dc57798 100755 --- a/bin/index +++ b/bin/index @@ -4,12 +4,18 @@ load 'util.rb' require 'yaml' # ARGV[0] -template = "bin/index.#{ARGV.shift}.erb" +type = ARGV.shift +template = "bin/index.#{type}.erb" erb = ERB.new(File.read(template)); erb.filename = template # ARGV[1] @path = ARGV.shift +webpath = (@path+'/').sub(/^(src|out)\//, '/') +if type == 'atom' + webpath += 'index.atom' +end +@url = URI::parse('https://www.andrewdm.me') + webpath indexyaml = @path.sub('out', 'src')+'/index.yaml' if File.exists?(indexyaml) -- cgit v1.2.3-2-g168b