Add ability to cache-bust opengraph images

This commit is contained in:
0x1eef 2024-06-21 06:14:23 -03:00
parent 39ea3b4ee8
commit 29993663d7
2 changed files with 2 additions and 2 deletions

View file

@ -15,7 +15,7 @@ module Mixin
end
def revision
cmd("git rev-parse HEAD").stdout.strip
@rev ||= cmd("git", "rev-parse", "HEAD").stdout.strip
end
def build_dir

View file

@ -12,7 +12,7 @@ module Mixin::OpenGraph
{title: t(context.locale, "TheNobleQuran"),
description: surah.name,
url: "#{base_url}/#{context.locale}/#{surah.slug}/",
image: "#{base_url}/images/og/#{surah.id}.png"}
image: "#{base_url}/images/og/#{surah.id}.png?v=#{revision}"}
when "redirect.html.erb", "surah-index.html.erb"
{title: t(context.locale, "TheNobleQuran"),
description: t(context.locale, "meta.index.description"),