Migrate to nanoc-gzip

This commit is contained in:
0x1eef 2023-06-29 19:49:42 -03:00
parent cc60461e80
commit 5748101c9a
6 changed files with 10 additions and 10 deletions

View file

@ -7,7 +7,7 @@ gem "nanoc", "~> 4.12"
##
# nanoc filters
gem "nanoc-gzip.rb", github: "0x1eef/nanoc-gzip.rb", tag: "v0.2.0"
gem "nanoc-gzip.rb", github: "0x1eef/nanoc-gzip.rb", tag: "v0.2.1"
gem "nanoc-webpack.rb", github: "0x1eef/nanoc-webpack.rb", tag: "v0.2.0"
gem "rainpress", "~> 1.0"
gem "sass", "~> 3.7"

View file

@ -1,9 +1,9 @@
GIT
remote: https://github.com/0x1eef/nanoc-gzip.rb.git
revision: 2e4df94c9759e3a7a7da92a0ad9b645c7ebe2660
tag: v0.2.0
revision: 3bb1719ad11d983a25945c1017df76aa2f6b8540
tag: v0.2.1
specs:
nanoc-gzip.rb (0.2.0)
nanoc-gzip.rb (0.2.1)
json (= 2.6.1)
nanoc (~> 4.12)
racc (= 1.6.0)

2
Rules
View file

@ -2,7 +2,7 @@
# frozen_string_literal: true
require "ryo"
require "nanoc-gunzip"
require "nanoc-gzip"
require "nanoc-webpack"
locales = %w[ar en]

View file

@ -8,7 +8,7 @@
# Fonts
compile "/fonts/*" do
write(item.identifier.to_s)
filter :gzip_binary
filter :gzip
write("#{item.identifier}.gz")
end
@ -16,7 +16,7 @@ end
# Images
compile "/images/*.svg" do
write(item.identifier.to_s)
filter :gzip_binary
filter :gzip
write("#{item.identifier}.gz")
end

View file

@ -18,7 +18,7 @@ compile "/js/pages/surah/index.tsx" do
"/js/lib/[!WebPackage]/",
"/js/hooks"]
write "/js/pages/surah/index.js"
filter :gzip_text
filter :gzip
write "/js/pages/surah/index.js.gz"
end

View file

@ -8,7 +8,7 @@
compile "/*/*/surah.json" do
write(item.identifier.to_s)
if File.size(item.raw_filename) > (1024 * 10)
filter :gzip_text
filter :gzip
write("#{item.identifier}.gz")
end
end
@ -29,7 +29,7 @@ compile "/js/pages/surah/stream.tsx" do
depend_on: ["/js/components", "/js/lib/", "/js/hooks"],
reject: proc { _1.include?("WebPackage") }
write "/js/pages/surah/stream.js"
filter :gzip_text
filter :gzip
write "/js/pages/surah/stream.js.gz"
end