diff --git a/nanoc/lib/mixin/opengraph.rb b/nanoc/lib/mixin/opengraph.rb index bf66a45..198e9bf 100644 --- a/nanoc/lib/mixin/opengraph.rb +++ b/nanoc/lib/mixin/opengraph.rb @@ -18,6 +18,11 @@ module Mixin::OpenGraph description: t(context.locale, "meta.index.description"), url: "https://<%= hostname %>/#{context.locale}/", image: "https://<%= hostname %>/images/og/0.png"} + when "random.html.erb" + {title: t(context.locale, "TheNobleQuran"), + description: t(context.locale, "meta.random.description"), + url: "https://<%= hostname %>/#{context.locale}/random/", + image: "https://<%= hostname %>/images/og/0.png"} end end end diff --git a/nanoc/rules/random.rules b/nanoc/rules/random.rules index dfef61a..689f12c 100644 --- a/nanoc/rules/random.rules +++ b/nanoc/rules/random.rules @@ -7,7 +7,7 @@ locales.each do |locale| compile "/html/main/random.html.erb", rep: "random/#{locale}" do - context = Ryo.from({locale:}) + context = Ryo.from({filename: "random.html.erb", locale:}) filter(:erb, locals: {locale:, locales:, context:}) filter(:tidy) write("/#{locale}/random/index.html") diff --git a/src/html/main/random.html.erb b/src/html/main/random.html.erb index a5d5b84..5a16d07 100644 --- a/src/html/main/random.html.erb +++ b/src/html/main/random.html.erb @@ -4,6 +4,7 @@ <%= t(context.locale, "TheNobleQuran") %> <%= erb("_revision.html.erb") %> + <%= opengraph(context) %>