al-quran.reflectslight.io/nanoc/rules/index.rules
0x1eef 1d641e7c71 Re-organize project files
Attempt to simplify the layout of project files.
2023-10-08 06:31:29 -03:00

35 lines
940 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(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/pages/surah-index.js"
filter :gzip
write "/js/pages/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/pages/surah-index.css")
end