2023-03-02 01:52:25 +01:00
|
|
|
#!/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.
|
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
|
|
|
|
|
2023-03-12 20:45:17 +01:00
|
|
|
Ryo.each(slugs) do |surah_id, slug|
|
2023-03-02 01:52:25 +01:00
|
|
|
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-11 22:41:22 +01:00
|
|
|
name = i18n[locale].surahs.names[surah_id.to_i - 1]
|
|
|
|
title = "#{i18n[locale].TheNobleQuran}: #{name}"
|
|
|
|
filter(:erb, locals: {locale:, surah_id:, title:})
|
2023-03-02 01:52:25 +01:00
|
|
|
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-27 17:23:20 +02:00
|
|
|
filter :webpack,
|
|
|
|
depend_on: ["/js/components", "/js/lib/", "/js/hooks"],
|
2023-05-29 03:28:15 +02:00
|
|
|
reject: proc { _1.include?("WebPackage") }
|
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
|