X-Git-Url: https://git.draconx.ca/gitweb/homepage.git/blobdiff_plain/0015d84bea1204b4534e5568ff7c0920b9ef02b7..da37bd9e9da585fdc382455b298739e21433c175:/Rules diff --git a/Rules b/Rules index d3247cb..c753c38 100644 --- a/Rules +++ b/Rules @@ -1,6 +1,6 @@ #!/usr/bin/env ruby # -# Copyright © 2018-2020 Nick Bowler +# Copyright © 2018-2022 Nick Bowler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -68,6 +68,8 @@ preprocess do @items.create("", attrs, "#{dir}/index.lst") end + + create_wkd_items(@items["/pubring.gpg"]) end postprocess do @@ -100,6 +102,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) @@ -179,11 +182,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' @@ -205,6 +218,19 @@ compile '/**/*.scss' do write @item.identifier.without_ext + '.css' end +compile '/gpg/*' do + filter :wkd_export_armor + write "/pubring/" + @item.identifier.components.last + ".asc" +end + +compile '/gpg/*', rep: :hu do + filter :wkd_export + write "/pubring/wkd/" + @item[:wkd_hash] +end + +compile '/*.gpg' do +end + compile '/**/*.svg' do filter :scour, comment_stripping: true write @item.identifier.to_s