2023-03-10 11:39:03 +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 a redirect from /<locale>/random/ to a random surah
|
|
|
|
# (eg /en/random/ -> /en/al-kahf/)
|
2023-03-10 11:39:03 +01:00
|
|
|
|
|
|
|
locales.each do |locale|
|
2023-10-08 10:02:01 +02:00
|
|
|
compile "/html/random.html.erb", rep: "random/#{locale}" do
|
2023-10-28 11:58:44 +02:00
|
|
|
context = Ryo.from({locale:})
|
|
|
|
filter(:erb, locals: {context:})
|
2023-03-10 11:39:03 +01:00
|
|
|
write("/#{locale}/random/index.html")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-10-08 10:02:01 +02:00
|
|
|
compile "/js/pages/Random.ts" do
|
|
|
|
filter(:webpack)
|
|
|
|
write("/js/pages/random.js")
|
2023-03-10 11:39:03 +01:00
|
|
|
end
|