al-quran.reflectslight.io/nanoc/rules/index.rules

35 lines
950 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/index.html.erb", rep: "/#{locale}/surah/index" do
context = Ryo.from(filename: "index.html.erb", locale:)
filter(:erb, locals: {context:})
filter(:tidy)
write "/#{locale}/index.html"
end
end
compile "/js/pages/SurahIndex.tsx" do
filter :webpack, depend_on: ["/js/components",
"/js/lib/[!WebPackage]/",
"/js/hooks"]
write "/js/surah-index.js"
filter :gzip
write "/js/surah-index.js.gz"
end
compile "/js/loaders/SurahIndexLoader.ts" do
filter :webpack, depend_on: "/js/lib/WebPackage"
write "/js/loaders/surah-index-loader.js"
end
compile "/css/pages/SurahIndex.scss" do
filter :sass, syntax: :scss, style: :compact
filter :rainpress
write("/css/surah-index.css")
end