summaryrefslogtreecommitdiff
path: root/bin/index
diff options
context:
space:
mode:
Diffstat (limited to 'bin/index')
-rwxr-xr-xbin/index8
1 files changed, 7 insertions, 1 deletions
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)