diff --git a/nanoc/lib/mixin/opengraph.rb b/nanoc/lib/mixin/opengraph.rb index ff95226..38321e4 100644 --- a/nanoc/lib/mixin/opengraph.rb +++ b/nanoc/lib/mixin/opengraph.rb @@ -2,18 +2,18 @@ module Mixin::OpenGraph def opengraph(context) - erb "partials/opengraph.html.erb", local_assigns(context) + erb "_opengraph.html.erb", local_assigns(context) end def local_assigns(context) case context.filename - when "stream.html.erb" + when "surah-stream.html.erb" surah = context.surah {title: t(context.locale, "TheNobleQuran"), description: t(context.locale, "meta.stream.description", surah_name: surah.name), url: "https://al-quran.reflectslight.io/#{context.locale}/#{surah.slug}/", image: "https://al-quran.reflectslight.io/images/og/#{surah.id}.png"} - when "index.html.erb" + when "surah-index.html.erb" {title: t(context.locale, "TheNobleQuran"), description: t(context.locale, "meta.index.description"), url: "https://al-quran.reflectslight.io/#{context.locale}/", diff --git a/nanoc/rules/index.rules b/nanoc/rules/index.rules index ea8e6c8..e99d9b9 100644 --- a/nanoc/rules/index.rules +++ b/nanoc/rules/index.rules @@ -6,8 +6,8 @@ # at // locales.each do |locale| - compile "/html/index.html.erb", rep: "/#{locale}/surah/index" do - context = Ryo.from(filename: "index.html.erb", locale:, locales:) + 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:}) filter(:tidy) diff --git a/nanoc/rules/random.rules b/nanoc/rules/random.rules index 3c6483a..1f7d8a8 100644 --- a/nanoc/rules/random.rules +++ b/nanoc/rules/random.rules @@ -6,7 +6,7 @@ # random surah (eg /en/random/ -> /en/al-kahf/) locales.each do |locale| - compile "/html/random.html.erb", rep: "random/#{locale}" do + compile "/html/main/random.html.erb", rep: "random/#{locale}" do context = Ryo.from({locale:}) filter(:erb, locals: {context:}) filter(:tidy) diff --git a/nanoc/rules/redirect.rules b/nanoc/rules/redirect.rules index bd2dec4..ae2161e 100644 --- a/nanoc/rules/redirect.rules +++ b/nanoc/rules/redirect.rules @@ -5,7 +5,7 @@ # Contains rules for a redirect from the root path # to the surah index for a given locale (eg / -> /en/) -compile "/html/redirect.html.erb" do +compile "/html/main/redirect.html.erb" do filter(:tidy) filter(:erb) write("/index.html") diff --git a/nanoc/rules/stream.rules b/nanoc/rules/stream.rules index 476844e..ad99e03 100644 --- a/nanoc/rules/stream.rules +++ b/nanoc/rules/stream.rules @@ -17,7 +17,7 @@ Ryo.each(name_by_id) do |id, slug| write_file = ->(locale, pathname:) do name = tdata[locale].surahs.names[id.to_i - 1] context = Ryo.from( - filename: "stream.html.erb", + filename: "surah-stream.html.erb", locale:, locales:, surah: {id:, name:, slug:} @@ -31,10 +31,10 @@ Ryo.each(name_by_id) do |id, slug| write "/#{locale}/#{pathname}/index.html" end locales.each do |locale| - compile "/html/stream.html.erb", rep: "/#{locale}/#{slug}/index.html" do + compile "/html/main/surah-stream.html.erb", rep: "/#{locale}/#{slug}/index.html" do instance_exec(locale, pathname: slug, &write_file) end - compile "/html/stream.html.erb", rep: "/#{locale}/#{id}/index.html" do + compile "/html/main/surah-stream.html.erb", rep: "/#{locale}/#{id}/index.html" do instance_exec(locale, pathname: id, &write_file) end end diff --git a/src/html/partials/favicon.html.erb b/src/html/_favicon.html.erb similarity index 100% rename from src/html/partials/favicon.html.erb rename to src/html/_favicon.html.erb diff --git a/src/html/partials/opengraph.html.erb b/src/html/_opengraph.html.erb similarity index 100% rename from src/html/partials/opengraph.html.erb rename to src/html/_opengraph.html.erb diff --git a/src/html/random.html.erb b/src/html/main/random.html.erb similarity index 82% rename from src/html/random.html.erb rename to src/html/main/random.html.erb index 7c2c737..3280cf2 100644 --- a/src/html/random.html.erb +++ b/src/html/main/random.html.erb @@ -2,7 +2,7 @@ <%= t(context.locale, "TheNobleQuran") %> - <%= erb("partials/favicon.html.erb") %> + <%= erb("_favicon.html.erb") %> diff --git a/src/html/redirect.html.erb b/src/html/main/redirect.html.erb similarity index 90% rename from src/html/redirect.html.erb rename to src/html/main/redirect.html.erb index b3a4214..e7c35e3 100644 --- a/src/html/redirect.html.erb +++ b/src/html/main/redirect.html.erb @@ -5,9 +5,9 @@ - <%= erb("partials/favicon.html.erb") %> - + <%= erb("_favicon.html.erb") %> + diff --git a/src/html/index.html.erb b/src/html/main/surah-index.html.erb similarity index 96% rename from src/html/index.html.erb rename to src/html/main/surah-index.html.erb index 5ba75b5..a382b2e 100644 --- a/src/html/index.html.erb +++ b/src/html/main/surah-index.html.erb @@ -6,7 +6,6 @@ - <%= erb("partials/favicon.html.erb") %> <% end %> + <%= erb("_favicon.html.erb") %> <%= opengraph(context) %> diff --git a/src/html/stream.html.erb b/src/html/main/surah-stream.html.erb similarity index 96% rename from src/html/stream.html.erb rename to src/html/main/surah-stream.html.erb index 511fc9c..32397c9 100644 --- a/src/html/stream.html.erb +++ b/src/html/main/surah-stream.html.erb @@ -6,7 +6,6 @@ '> - <%= erb("partials/favicon.html.erb") %> <% end %> + <%= erb("_favicon.html.erb") %> <%= opengraph(context) %>