Merge pull request #86 from ReflectsLight/new_index
Redirect to the surah index from the root path
This commit is contained in:
commit
414ef6f703
4 changed files with 24 additions and 5 deletions
|
@ -4,11 +4,6 @@
|
||||||
# Contains rules that are related to RandomRedirect.html.erb
|
# Contains rules that are related to RandomRedirect.html.erb
|
||||||
# in one way or another
|
# in one way or another
|
||||||
|
|
||||||
compile "/html/RandomRedirect.html.erb" do
|
|
||||||
filter(:erb)
|
|
||||||
write("/index.html")
|
|
||||||
end
|
|
||||||
|
|
||||||
compile "/html/redirect-to-surah-slug.html.erb" do
|
compile "/html/redirect-to-surah-slug.html.erb" do
|
||||||
filter(:erb)
|
filter(:erb)
|
||||||
1.upto(114) do |surahno|
|
1.upto(114) do |surahno|
|
||||||
|
|
|
@ -4,6 +4,16 @@
|
||||||
# Contains rules that are related to TheSurahIndex in one
|
# Contains rules that are related to TheSurahIndex in one
|
||||||
# way or another.
|
# way or another.
|
||||||
|
|
||||||
|
compile "/html/surah/index/redirect.html.erb" do
|
||||||
|
filter(:erb)
|
||||||
|
write("/index.html")
|
||||||
|
end
|
||||||
|
|
||||||
|
compile "/js/surah/index/redirect.ts" do
|
||||||
|
filter(:webpack)
|
||||||
|
write("/js/surah/index/redirect.js")
|
||||||
|
end
|
||||||
|
|
||||||
compile "/surahs.json" do
|
compile "/surahs.json" do
|
||||||
write "/surahs.json"
|
write "/surahs.json"
|
||||||
end
|
end
|
||||||
|
|
8
src/html/surah/index/redirect.html.erb
Normal file
8
src/html/surah/index/redirect.html.erb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="/js/surah/index/redirect.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
6
src/js/surah/index/redirect.ts
Normal file
6
src/js/surah/index/redirect.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { Locale } from 'lib/Locale';
|
||||||
|
|
||||||
|
(function(window, location) {
|
||||||
|
const locale = Locale(window).fromBrowser();
|
||||||
|
location.replace(`/${locale}/`);
|
||||||
|
})(window, location);
|
Loading…
Reference in a new issue