al-quran.reflectslight.io/nanoc/rules/random.rules

23 lines
656 B
Text
Raw Normal View History

2023-03-10 11:39:03 +01:00
#!/usr/bin/env ruby
2023-03-11 18:31:44 +01:00
# frozen_string_literal: true
2024-05-04 02:28:26 +02:00
##
# Contains rules for a redirect from /<locale>/random/ to a
2024-05-02 16:29:46 +02:00
# random surah (eg /en/random/ -> /en/al-kahf/)
2023-03-10 11:39:03 +01:00
locales.each do |locale|
compile "/html/main/random.html.erb", rep: "random/#{locale}" do
context = Ryo.from({filename: "random.html.erb", dir: tdata[locale].dir, locale:, locales:})
filter(:erb, locals: {locale:, locales:, dir: context.dir, context:})
filter(:tidy)
2023-03-10 11:39:03 +01:00
write("/#{locale}/random/index.html")
end
end
2024-03-16 09:18:03 +01:00
compile "/js/main/random.ts" do
2024-03-16 15:13:27 +01:00
filter(:webpack, depend_on: ["/js/lib/"])
2024-03-16 09:18:03 +01:00
write("/js/main/random.js")
2024-06-09 06:02:08 +02:00
filter(:gzip)
write("/js/main/random.js.gz")
2023-03-10 11:39:03 +01:00
end