0x1eef
6e1a7aec51
Add a nanoc filter that runs HTML content through [tidy-html](https://github.com/htacg/tidy-html5). The content that is first run through ERB is often indented incorrectly and inconsistently, and 'tidy' can fix that for us.
35 lines
952 B
Ruby
35 lines
952 B
Ruby
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
##
|
|
# Rules for the surah index available at /<locale>/ (eg /en/) and its
|
|
# dependencies.
|
|
|
|
locales.each do |locale|
|
|
compile "/html/pages/surah/index.html.erb", rep: "/#{locale}/surah/index" do
|
|
context = Ryo.from(locale:)
|
|
filter(:erb, locals: {context:})
|
|
filter(:tidy)
|
|
write "/#{locale}/index.html"
|
|
end
|
|
end
|
|
|
|
compile "/js/pages/surah/index.tsx" do
|
|
filter :webpack, depend_on: ["/js/components",
|
|
"/js/lib/[!WebPackage]/",
|
|
"/js/hooks"]
|
|
write "/js/pages/surah/index.js"
|
|
filter :gzip
|
|
write "/js/pages/surah/index.js.gz"
|
|
end
|
|
|
|
compile "/js/pages/surah/index/loader.ts" do
|
|
filter :webpack, depend_on: "/js/lib/WebPackage"
|
|
write "/js/pages/surah/index/loader.js"
|
|
end
|
|
|
|
compile "/css/pages/surah/index.scss" do
|
|
filter :sass, syntax: :scss, style: :compact
|
|
filter :rainpress
|
|
write("/css/pages/surah/index.css")
|
|
end
|