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

45 lines
1.2 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)
2023-06-30 00:49:42 +02:00
filter :gzip
write("#{item.identifier}.gz")
end
end
Ryo.each(slugs) 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
surah_name = i18n[locale].surahs.names[surah_id.to_i - 1]
filter(:erb, locals: {locale:, surah_id:, surah_name:})
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-06-30 00:49:42 +02:00
filter :gzip
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