al-quran.reflectslight.io/nanoc/lib/mixins/opengraph.rb
2023-10-05 02:36:47 -03:00

19 lines
601 B
Ruby

use_helper Module.new {
require_relative "helper"
include Helper
def opengraph(locale, basename, options = {})
erb "opengraph.html.erb", local_assigns(locale, basename, options)
end
def local_assigns(locale, basename, options)
case basename
when "stream.html.erb"
surah_id = options[:surah_id]
{ title: t(locale, "TheNobleQuran"),
description: t(locale, "meta.stream.description"),
url: "https://al-quran.reflectslight.io/#{locale}/#{surah_id}/",
image: "https://al-quran.reflectslight.io/images/opengraph/#{surah_id}.png" }
end
end
}