From 8a886accf0c17532c8fa56be0b7b1d5c76e98301 Mon Sep 17 00:00:00 2001 From: Yanislav Igonin Date: Sun, 24 Oct 2021 12:41:37 +0300 Subject: [PATCH] feat: first post image as seo image (#2) --- templates/meta-tags-dynamic.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/templates/meta-tags-dynamic.html b/templates/meta-tags-dynamic.html index 672e6dc..95aa2f3 100644 --- a/templates/meta-tags-dynamic.html +++ b/templates/meta-tags-dynamic.html @@ -1,4 +1,13 @@ {{ define "meta-tags-dynamic" }} + +{{ $SeoImageUrl := "" }} +{{ if .Files }} + {{ $FirstFile := index .Files 0 }}ы + {{ $SeoImageUrl = printf "https://micrach.igonin.dev/uploads/%d/t/%d.%s" .ID $FirstFile.ID $FirstFile.Ext }} +{{ else }} + {{ $SeoImageUrl = "https://memepedia.ru/wp-content/uploads/2018/03/ebanyy-rot-etogo-kazino.png" }} +{{ end }} + {{ .Title }} @@ -11,12 +20,12 @@ - + - + - + {{ end }} \ No newline at end of file