Add surah/id_redirect
This commit is contained in:
parent
2dfadcb937
commit
9fef5122eb
4 changed files with 17 additions and 1 deletions
1
Rules
1
Rules
|
@ -34,6 +34,7 @@ require_rules "rules/pages/surah/random", {locales:, surah_id_to_name:}
|
|||
require_rules "rules/pages/surah/stream", {locales:, surah_id_to_name:}
|
||||
require_rules "rules/pages/surah/index", {locales:}
|
||||
require_rules "rules/pages/surah/redirect"
|
||||
require_rules "rules/pages/surah/id_redirect", {locales:}
|
||||
|
||||
##
|
||||
# Defaults
|
||||
|
|
15
rules/pages/surah/id_redirect.rules
Normal file
15
rules/pages/surah/id_redirect.rules
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
1.upto(114) do |id|
|
||||
locales.each do |locale|
|
||||
compile "/html/pages/surah/id_redirect.html.erb", rep: "redirect_id/#{id}" do
|
||||
filter(:erb)
|
||||
write("/#{locale}/#{id}/index.html")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
compile "/js/pages/surah/id_redirect.ts" do
|
||||
filter(:webpack)
|
||||
write("/js/pages/surah/id_redirect.js")
|
||||
end
|
|
@ -7,6 +7,6 @@
|
|||
<script class="surah-id-to-slug" type="application/json">
|
||||
<%= File.read(File.join(Dir.getwd, "src", "slugs.json")) %>
|
||||
</script>
|
||||
<script src="/js/pages/redirect-to-surah-slug.js"></script>
|
||||
<script src="/js/pages/surah/id_redirect.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue