summaryrefslogtreecommitdiff
path: root/bin/index
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 20:57:36 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-03 20:57:36 -0500
commita5f4e1ed470b96c1f97f3827fe07d530c53f0e5c (patch)
treec4ab7430b9c2f54e9ab3ac10f62f0321af6578de /bin/index
parent5449dca686d7bdbd5f09acd4e9fd8647535acde9 (diff)
I hate URL handling.
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)