From d89ff14d7032685f0fb63da8f4b7506d7076956f Mon Sep 17 00:00:00 2001 From: miraikumiko Date: Mon, 14 Apr 2025 10:37:06 +0200 Subject: Update social links --- layouts/partials/footer.html | 4 +- layouts/partials/seo_tags.html | 19 +------ layouts/partials/social_card.html | 102 ++------------------------------------ 3 files changed, 6 insertions(+), 119 deletions(-) (limited to 'layouts') diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 9290715..ded7490 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,3 +1,3 @@ - {{ .Site.Copyright }} | {{ markdownify .Site.Params.madeWith }} - \ No newline at end of file + {{ .Site.Copyright }} {{ range $title, $link := .Site.Params.links }} | {{ title $title }} {{ end }} + diff --git a/layouts/partials/seo_tags.html b/layouts/partials/seo_tags.html index 6ab1422..63d4d6e 100644 --- a/layouts/partials/seo_tags.html +++ b/layouts/partials/seo_tags.html @@ -1,22 +1,5 @@ - + - - - - - -{{ if and (and (default false .Site.Params.generateSocialCard) (not (isset .Params "images"))) (eq .Kind "page") }} - {{ partial "social_card.html" . }} -{{ else }} - - {{ template "_internal/opengraph.html" . }} - - - {{ template "_internal/twitter_cards.html" . }} - - - {{ template "_internal/schema.html" . }} -{{ end }} diff --git a/layouts/partials/social_card.html b/layouts/partials/social_card.html index d171da0..520162c 100644 --- a/layouts/partials/social_card.html +++ b/layouts/partials/social_card.html @@ -1,9 +1,9 @@ -{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/ofl/firamono/FiraMono-Bold.ttf" }} +{{ $font := resources.Get "fonts/FiraMono-Bold.ttf" }} {{ $fg := resources.Get "images/social_card_fg.png"}} {{ $bg := resources.Get "images/social_card_bg.png"}} -{{ if gt (len .Title) 45 }} +{{ if gt (len .Title) 40 }} {{ $fg = $fg.Filter (images.Text .Title (dict "font" $font "color" "#fafafa" @@ -24,7 +24,7 @@ {{ end }} {{ $date := .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} -{{ $author := (default $.Site.Params.author.name ($.Param "author") ) }} +{{ $author := (default $.Site.Params.author.name ($.Param "author.name")) }} {{ $byline := (printf "%s | %s" $author $date) }} {{ $fg = $fg.Filter (images.Text $byline (dict @@ -38,99 +38,3 @@ {{ $card := $bg.Filter (images.Overlay $fg 112 140 ) }} {{ $card := $card.Resize "900x webp q100" }} - - - - - - - - - - -{{- if .IsPage }} -{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} - -{{ with .PublishDate }}{{ end }} -{{ with .Lastmod }}{{ end }} -{{- end -}} - -{{- with .Params.audio }}{{ end }} -{{- with .Params.locale }}{{ end }} -{{- with .Site.Params.title }}{{ end }} -{{- with .Params.videos }}{{- range . }} - -{{ end }}{{ end }} - -{{- /* If it is part of a series, link to related articles */}} -{{- $permalink := .Permalink }} -{{- $siteSeries := .Site.Taxonomies.series }} -{{- if $siteSeries }} -{{ with .Params.series }}{{- range $name := . }} - {{- $series := index $siteSeries ($name | urlize) }} - {{- range $page := first 6 $series.Pages }} - {{- if ne $page.Permalink $permalink }}{{ end }} - {{- end }} -{{ end }}{{ end }} -{{- end }} - -{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} -{{- $facebookAdmin := "" }} -{{- with site.Params.social }} - {{- if reflect.IsMap . }} - {{- $facebookAdmin = .facebook_admin }} - {{- end }} -{{- else }} - {{- with site.Social.facebook_admin }} - {{- $facebookAdmin = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} - {{- end }} -{{- end }} - -{{- /* Facebook Page Admin ID for Domain Insights */}} -{{ with $facebookAdmin }}{{ end }} - - - - - - - - -{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} -{{- $twitterSite := "" }} -{{- with site.Params.social }} - {{- if reflect.IsMap . }} - {{- $twitterSite = .twitter }} - {{- end }} -{{- else }} - {{- with site.Social.twitter }} - {{- $twitterSite = . }} - {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} - {{- end }} -{{- end }} - -{{- with $twitterSite }} - {{- $content := . }} - {{- if not (strings.HasPrefix . "@") }} - {{- $content = printf "@%v" $twitterSite }} - {{- end }} - -{{- end }} - - - - - - -{{- if .IsPage -}} -{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} -{{ with .PublishDate }}{{ end}} -{{ with .Lastmod }}{{ end}} - - - - - - -{{- end -}} -- cgit v1.2.3