X-Git-Url: http://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/6493de72be35a962a45a31059c7e90a8e9c3b737..3f707bce834daa1c9c3f5029611090430caa2178:/Rules diff --git a/Rules b/Rules index d48f287..ebe9cf2 100644 --- a/Rules +++ b/Rules @@ -49,6 +49,25 @@ preprocess do item[:updated_at] ||= item[:updated] || File.stat(item.raw_filename).mtime end + + archivedirs = {} + @items.find_all('/archive/**/*').each do |item| + dir = File.dirname(item.identifier) + while dir != "/" + archivedirs[dir] = true + dir = File.dirname(dir) + end + end + + archivedirs.keys.sort_by{ |s| -s.length }.each do |dir| + attrs = { + pattern: "#{dir}/*{,/index.lst}", + title: "Index of #{dir}", + gitrev: commit, + } + + @items.create("", attrs, "#{dir}/index.lst") + end end postprocess do @@ -72,6 +91,8 @@ postprocess do Open3.popen2("git", "-c", "core.bare=false", "annex", "registerurl") do |stdin, stdout, result| @items.each do |item| + next if item.raw_filename.nil? + l = File.readlink(item.raw_filename) next unless l =~ %r{/annex/objects/} @@ -107,6 +128,15 @@ postprocess do end end +compile '/**/index.lst' do + layout '/listing.erb' + layout '/default.xml' + layout '/default.xsl' + filter :relativize_paths, type: :xml + filter :xhtml_compat + write item.identifier.without_ext + ".xhtml" +end + compile '/license/gpl*.md' do filter :kramdown, auto_ids: false, header_offset: -1 layout '/default.xml' @@ -114,7 +144,6 @@ compile '/license/gpl*.md' do layout '/default.xsl' filter :relativize_paths, type: :xml filter :xhtml_compat - filter :remove_wj write to_xhtml end @@ -126,7 +155,6 @@ compile '/**/*.md' do layout '/default.xsl' filter :relativize_paths, type: :xml filter :xhtml_compat - filter :remove_wj write to_xhtml end @@ -137,7 +165,6 @@ compile '/license/cc*.sgml' do layout '/default.xsl', "section-links": "yes" filter :relativize_paths, type: :xml filter :xhtml_compat - filter :remove_wj write to_xhtml end @@ -147,7 +174,6 @@ compile '/license/cc*.xhtml' do layout '/default.xsl', "section-links": "yes" filter :relativize_paths, type: :xml filter :xhtml_compat - filter :remove_wj write to_xhtml end @@ -164,7 +190,6 @@ compile '/images/*.jpg', rep: :info do layout '/default.xsl' filter :relativize_paths, type: :xml filter :xhtml_compat - filter :remove_wj write to_xhtml end @@ -179,6 +204,11 @@ compile '/**/*.scss' do write @item.identifier.without_ext + '.css' end +compile '/**/*.svg' do + filter :scour, comment_stripping: true + write @item.identifier.to_s +end + compile '/**/*' do filter :copybin if @item.binary? write @item.identifier.to_s