+postprocess do
+ # Gzip all text items for nginx http_static
+ if !ENV['GZIP_SITE'].to_s.empty?
+ reps = @items.flat_map(&:reps).each do |rep|
+ file = rep.raw_path
+ next if !file or rep.binary?
+
+ if system("gzip", "-ck9", file, [:out]=>[file + ".gz.tmp", "wb"])
+ system("touch", "-r", file, file + ".gz.tmp")
+ File.rename(file + ".gz.tmp", file + ".gz")
+ else
+ File.unlink(file + ".gz.tmp")
+ end
+ end
+ end
+end
+
+compile '/license/gpl*.md' do
+ filter :kramdown, auto_ids: false, header_offset: -1
+ layout '/default.xml'
+ layout '/gpl.xsl'
+ layout '/default.xsl'
+ filter :relativize_paths, type: :xml
+ filter :xhtml_compat
+ filter :remove_wj
+ write to_xhtml
+end
+