2023-10-05 00:49:26 +02:00
|
|
|
use_helper Module.new {
|
|
|
|
require_relative "helper"
|
|
|
|
include Helper
|
|
|
|
|
2023-10-05 16:51:39 +02:00
|
|
|
def opengraph(context)
|
|
|
|
erb "opengraph.html.erb", local_assigns(context)
|
2023-10-05 00:49:26 +02:00
|
|
|
end
|
|
|
|
|
2023-10-05 16:51:39 +02:00
|
|
|
def local_assigns(context)
|
|
|
|
case context.filename
|
2023-10-05 00:49:26 +02:00
|
|
|
when "stream.html.erb"
|
2023-10-05 16:51:39 +02:00
|
|
|
{ title: t(context.locale, "TheNobleQuran"),
|
|
|
|
description: t(context.locale, "meta.stream.description"),
|
|
|
|
url: "https://al-quran.reflectslight.io/#{context.locale}/#{context.surah.slug}/",
|
|
|
|
image: "https://al-quran.reflectslight.io/images/opengraph/#{context.surah.id}.png" }
|
2023-10-05 00:49:26 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|