2023-03-02 01:52:25 +01:00
|
|
|
#!/usr/bin/env ruby
|
2023-03-10 14:51:34 +01:00
|
|
|
|
|
|
|
##
|
2023-03-10 14:41:19 +01:00
|
|
|
# Rules for the surah stream available at /<locale>/<name>/ (eg /ar/al-fatihah/)
|
|
|
|
# and its dependencies.
|
2023-03-02 01:52:25 +01:00
|
|
|
|
|
|
|
compile "/*/*/surah.json" do
|
|
|
|
write(item.identifier.to_s)
|
|
|
|
if File.size(item.raw_filename) > (1024 * 10)
|
|
|
|
filter :gzip_text
|
|
|
|
write("#{item.identifier}.gz")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Ryo.each(surah_id_to_name) do |surah_id, slug|
|
|
|
|
locales.each do |locale|
|
2023-03-10 10:47:35 +01:00
|
|
|
compile "/html/pages/surah/stream.html.erb", rep: "/#{locale}/#{slug}/index.html" do
|
2023-03-02 01:52:25 +01:00
|
|
|
filter :erb, locals: {locale: locale, surah_id: surah_id}
|
|
|
|
write "/#{locale}/#{slug}/index.html"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-03-10 10:47:35 +01:00
|
|
|
compile "/js/pages/surah/stream.tsx" do
|
2023-03-02 01:52:25 +01:00
|
|
|
filter :webpack, depend_on: ["/js/components", "/js/lib/[!WebPackage]/", "/js/hooks"]
|
2023-03-10 10:47:35 +01:00
|
|
|
write "/js/pages/surah/stream.js"
|
2023-03-02 01:52:25 +01:00
|
|
|
filter :gzip_text
|
2023-03-10 10:47:35 +01:00
|
|
|
write "/js/pages/surah/stream.js.gz"
|
2023-03-02 01:52:25 +01:00
|
|
|
end
|
|
|
|
|
2023-03-10 10:47:35 +01:00
|
|
|
compile "/js/pages/surah/stream/loader.ts" do
|
2023-03-02 01:52:25 +01:00
|
|
|
filter :webpack, depend_on: "/js/lib/WebPackage"
|
2023-03-10 10:47:35 +01:00
|
|
|
write "/js/pages/surah/stream/loader.js"
|
2023-03-02 01:52:25 +01:00
|
|
|
end
|
|
|
|
|
2023-03-10 10:47:35 +01:00
|
|
|
compile "/css/pages/surah/stream.scss" do
|
2023-03-02 01:52:25 +01:00
|
|
|
filter :sass, syntax: :scss, style: :compact
|
|
|
|
filter :rainpress
|
2023-03-10 10:47:35 +01:00
|
|
|
write("/css/pages/surah/stream.css")
|
2023-03-02 01:52:25 +01:00
|
|
|
end
|