al-quran.reflectslight.io/rules/pages/surah/random.rules
0x1eef 5f957af84c Set document title at compile time
This change will hopefully make it easier for search engines to
pick up a page's title.
2023-03-12 11:23:48 -03:00

19 lines
486 B
Ruby

#!/usr/bin/env ruby
# frozen_string_literal: true
##
# Rules for a redirect from /<locale>/random/ to a random surah
# (eg /en/random/ -> /en/al-kahf/)
locales.each do |locale|
compile "/html/pages/surah/random.html.erb", rep: "random/#{locale}" do
title = i18n[locale].TheNobleQuran
filter(:erb, locals: {locale:, title:})
write("/#{locale}/random/index.html")
end
end
compile "/js/pages/surah/random.ts" do
filter :webpack
write "/js/pages/surah/random.js"
end