From 8aaab06170a7c4622c7e7526a3841d3c02a1e667 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 10 Mar 2023 08:16:41 -0300 Subject: [PATCH] rules/: update comments --- rules/pages/surah/id_redirect.rules | 4 ++++ rules/pages/surah/index.rules | 4 ++-- rules/pages/surah/random.rules | 3 ++- rules/pages/surah/redirect.rules | 4 ++-- rules/pages/surah/stream.rules | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/rules/pages/surah/id_redirect.rules b/rules/pages/surah/id_redirect.rules index 6d768f27a..e314803ff 100644 --- a/rules/pages/surah/id_redirect.rules +++ b/rules/pages/surah/id_redirect.rules @@ -1,5 +1,9 @@ #!/usr/bin/env ruby +## +# Rules for a redirect from a surah id to +# a surah name (eg /en/1/ -> /en/al-fatihah/) + 1.upto(114) do |id| locales.each do |locale| compile "/html/pages/surah/id_redirect.html.erb", rep: "redirect_id/#{id}" do diff --git a/rules/pages/surah/index.rules b/rules/pages/surah/index.rules index 276362605..11a2b2781 100644 --- a/rules/pages/surah/index.rules +++ b/rules/pages/surah/index.rules @@ -1,8 +1,8 @@ #!/usr/bin/env ruby ## -# The surah index (available at /en, /ar, etc) and -# its dependencies. +# Rules for the surah index available at //, +# (eg /en/) and its dependencies. locales.each do |locale| compile "/html/pages/surah/index.html.erb", rep: "/#{locale}/surah/index" do diff --git a/rules/pages/surah/random.rules b/rules/pages/surah/random.rules index 5e2055f42..0f1ad9282 100644 --- a/rules/pages/surah/random.rules +++ b/rules/pages/surah/random.rules @@ -1,7 +1,8 @@ #!/usr/bin/env ruby ## -# Redirects to a random surah +# Rules for a redirect from //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 diff --git a/rules/pages/surah/redirect.rules b/rules/pages/surah/redirect.rules index 4ab0d2de1..2e33ebf39 100644 --- a/rules/pages/surah/redirect.rules +++ b/rules/pages/surah/redirect.rules @@ -1,8 +1,8 @@ #!/usr/bin/env ruby ## -# Redirect from the root path to the surah index -# for a given locale (eg '/ -> /en', '/ -> /ar', etc) +# Rules for a redirect from the root path to the surah +# index for a given locale (eg / -> /en/) compile "/html/pages/surah/redirect.html.erb" do filter(:erb) diff --git a/rules/pages/surah/stream.rules b/rules/pages/surah/stream.rules index 45ecd296c..ed99bba14 100644 --- a/rules/pages/surah/stream.rules +++ b/rules/pages/surah/stream.rules @@ -1,8 +1,8 @@ #!/usr/bin/env ruby ## -# Contains rules that are related to TheSurahPage.html.erb in one -# way or another +# Rules for the surah stream available at /// +# (eg /ar/al-fatihah/) and its dependencies. compile "/*/*/surah.json" do write(item.identifier.to_s)