X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=build.rb;h=4afd7d1e6ce9df39cbc5d39e02cbe2fa67e97843;hb=6a0e2acebdf4bb70c77ac562ce73d963f03e0754;hp=77bca1008a70d3b78989eec352bdab501a37794b;hpb=f188aabf74da7925e36bc8fb8e22221b197f4bf6;p=ardour-manual diff --git a/build.rb b/build.rb index 77bca10..4afd7d1 100644 --- a/build.rb +++ b/build.rb @@ -81,18 +81,16 @@ class Page @site = site @path = path - canon = canonical - @out_path = @site.output_dir + canon + Pathname("index.html") - @url = '/' + canon + '/' - @sort_url = @path.to_s.sub(/\.html$/, '') - end + relative_path = @path.relative_path_from(@site.pages_dir); + a = relative_path.each_filename.map do |x| + x.sub(/^[0-9]*[-_]/, '') + end + a[-1].sub!(/\.html$/, '') + s = a.join('/') - def canonical() - remove_numbers = lambda {|x| x.sub(/^[0-9]*[-_]/, '') } - path = @path.relative_path_from(@site.pages_dir) - a = path.each_filename.map(&remove_numbers) - a[-1] = a[-1].sub(/\.html$/, '') - a.join('/') + @out_path = @site.output_dir + Pathname(s) + Pathname("index.html") + @url = "/#s/" + @sort_url = @path.to_s.sub(/\.html$/, '') end def related_to?(p) @@ -229,7 +227,6 @@ class Server listener end -<<<<<<< HEAD def run(options) require 'webrick' listener = options[:watch] && start_watcher