al-quran.reflectslight.io/rules/pages/surah/stream.rules

42 lines
1.1 KiB
Text
Raw Normal View History

#!/usr/bin/env ruby
2023-03-11 18:31:44 +01:00
# frozen_string_literal: true
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.
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
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
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"
filter :gzip_text
2023-03-10 10:47:35 +01:00
write "/js/pages/surah/stream.js.gz"
end
2023-03-10 10:47:35 +01:00
compile "/js/pages/surah/stream/loader.ts" do
filter :webpack, depend_on: "/js/lib/WebPackage"
2023-03-10 10:47:35 +01:00
write "/js/pages/surah/stream/loader.js"
end
2023-03-10 10:47:35 +01:00
compile "/css/pages/surah/stream.scss" do
filter :sass, syntax: :scss, style: :compact
filter :rainpress
2023-03-10 10:47:35 +01:00
write("/css/pages/surah/stream.css")
end