X-Git-Url: https://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/3f707bce834daa1c9c3f5029611090430caa2178..86d0dac7b5713b9d312dd8fea8da80132829d6e6:/Rules diff --git a/Rules b/Rules index ebe9cf2..26bcb40 100644 --- a/Rules +++ b/Rules @@ -100,6 +100,7 @@ postprocess do # Find output reps corresponding to this key, if any item.reps.each do |rep| + next if rep.raw_path.nil? next unless FileUtils.identical?(item.raw_filename, rep.raw_path) @@ -132,8 +133,9 @@ compile '/**/index.lst' do layout '/listing.erb' layout '/default.xml' layout '/default.xsl' + layout '/embed-svg.xsl' filter :relativize_paths, type: :xml - filter :xhtml_compat + filter :xhtml_compat, fix_doctype: true write item.identifier.without_ext + ".xhtml" end @@ -178,11 +180,21 @@ compile '/license/cc*.xhtml' do end compile '/images/*.jpg', rep: :large do + w, h = FastImage.size(item.raw_filename) filename = item.identifier.without_ext + '-t1200.' + item.identifier.ext - filter :imgresize, width: 1200, height: 1200, cache: filename + filter :imgresize, width: [w, 1200].min, height: [h, 1200].min, cache: filename write filename end +compile '/images/*.jpg', rep: :medium do + w, h = FastImage.size(item.raw_filename) + filename = item.identifier.without_ext + '-t800.' + item.identifier.ext + if w > 900 or h > 900 + filter :imgresize, width: 800, height: 800, cache: filename + write filename + end +end + compile '/images/*.jpg', rep: :info do filter :imginfo layout '/imginfo.xsl' @@ -209,6 +221,11 @@ compile '/**/*.svg' do write @item.identifier.to_s end +compile '/icons/**/*.svg', rep: :icon32 do + filter :svg2png, width: 32, height: 32 + write @item.identifier.without_ext + "-32.png" +end + compile '/**/*' do filter :copybin if @item.binary? write @item.identifier.to_s