Update {random,surah-index,surah-stream}.html.erb
Add dir attribute
This commit is contained in:
parent
fbb87bdf25
commit
4b041571f3
9 changed files with 15 additions and 12 deletions
2
Rules
2
Rules
|
@ -61,7 +61,7 @@ passthrough "/json/durations/*/*.json"
|
|||
# require rules
|
||||
require_rules "nanoc/rules/assets"
|
||||
require_rules "nanoc/rules/redirect", {locales:}
|
||||
require_rules "nanoc/rules/random", {locales:}
|
||||
require_rules "nanoc/rules/random", {locales:, tdata:}
|
||||
require_rules "nanoc/rules/stream", {locales:, tdata:, name_by_id:}
|
||||
require_rules "nanoc/rules/index", {locales:, tdata:}
|
||||
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
|
||||
locales.each do |locale|
|
||||
compile "/html/main/surah-index.html.erb", rep: "/#{locale}/surah/index" do
|
||||
context = Ryo.from(filename: "surah-index.html.erb", locale:, locales:)
|
||||
locals = {locale: context.locale, locales: context.locales, context:}
|
||||
filter(:erb, {locals:})
|
||||
context = Ryo.from(filename: "surah-index.html.erb", dir: tdata[locale].dir, locale:, locales:)
|
||||
filter(:erb, {locals: {locale:, locales:, dir: context.dir, context:}})
|
||||
filter(:tidy)
|
||||
write "/#{locale}/index.html"
|
||||
end
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
locales.each do |locale|
|
||||
compile "/html/main/random.html.erb", rep: "random/#{locale}" do
|
||||
context = Ryo.from({filename: "random.html.erb", locale:})
|
||||
filter(:erb, locals: {locale:, locales:, context:})
|
||||
context = Ryo.from({filename: "random.html.erb", dir: tdata[locale].dir, locale:, locales:})
|
||||
filter(:erb, locals: {locale:, locales:, dir: context.dir, context:})
|
||||
filter(:tidy)
|
||||
write("/#{locale}/random/index.html")
|
||||
end
|
||||
|
|
|
@ -20,11 +20,12 @@ Ryo.each(name_by_id) do |id, slug|
|
|||
filename: "surah-stream.html.erb",
|
||||
locale:,
|
||||
locales:,
|
||||
surah: {id:, name:, slug:}
|
||||
surah: {id:, name:, slug:},
|
||||
dir: tdata[locale].dir
|
||||
)
|
||||
locals = {
|
||||
locale: context.locale, locales: context.locales,
|
||||
surah: context.surah, context:
|
||||
surah: context.surah, dir: context.dir, context:
|
||||
}
|
||||
filter(:erb, locals:)
|
||||
filter(:tidy)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= locale %>">
|
||||
<html lang="<%= locale %>" dir="<%= dir %>">
|
||||
<head>
|
||||
<title><%= t(locale, "TheNobleQuran") %></title>
|
||||
<meta name="description" content="<%= t(locale, 'meta.random.description') %>">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="en" dir="ltr">
|
||||
<head>
|
||||
<title><%= t("en", "TheNobleQuran") %></title>
|
||||
<%= erb("_revision.html.erb") %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= locale %>">
|
||||
<html lang="<%= locale %>" dir="<%= dir %>">
|
||||
<head>
|
||||
<title><%= t(locale, "TheNobleQuran") %></title>
|
||||
<%= inline_css('/css/vendor/postman.css') %>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= locale %>">
|
||||
<html lang="<%= locale %>" dir="<%= dir %>">
|
||||
<head>
|
||||
<title><%= surah.name %></title>
|
||||
<%= inline_css('/css/vendor/postman.css') %>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"en": {
|
||||
"dir": "ltr",
|
||||
"TheNobleQuran": "The Noble Quran",
|
||||
"ChooseRandomChapter": "Select a random surah",
|
||||
"surah": "Surah",
|
||||
|
@ -134,6 +135,7 @@
|
|||
}
|
||||
},
|
||||
"ar": {
|
||||
"dir": "rtl",
|
||||
"TheNobleQuran": "القرآن الكريم",
|
||||
"ChooseRandomChapter": "اختر سورة عشوائية",
|
||||
"surah": "سورة",
|
||||
|
@ -274,6 +276,7 @@
|
|||
}
|
||||
},
|
||||
"fa": {
|
||||
"dir": "rtl",
|
||||
"TheNobleQuran": "قرآن کریم",
|
||||
"ChooseRandomChapter": "یک سوره تصادفی انتخاب کنید",
|
||||
"surah": "سوره",
|
||||
|
|
Loading…
Reference in a new issue