Add opengraph to /<locale>/random/

This commit is contained in:
0x1eef 2024-05-25 23:12:42 -03:00
parent 5b10986d22
commit 09365dd283
3 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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")

View file

@ -4,6 +4,7 @@
<title><%= t(context.locale, "TheNobleQuran") %></title>
<meta name="description" content="<%= t(locale, 'meta.random.description') %>">
<%= erb("_revision.html.erb") %>
<%= opengraph(context) %>
<link
rel="canonical"
href="https://<%= hostname %>/<%= locale %>/random/"