Skip to content

Commit

Permalink
Fix template issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed May 29, 2024
1 parent 6b4a48a commit 4df57c1
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions themes/mastodon/layouts/partials/head/open_graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
<meta property="og:url" content="{{ .Permalink }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />

{{ if .IsHome }}
{{- if .IsHome }}
<meta name="og:image" content="{{ "preview.png" | absURL }}" />
{{ else }}
{{ if isset .Params "hero" }}
{{- else }}
{{- if isset .Params "hero" }}
<meta name="og:image" content="{{ .Params.hero }}" />
{{ else }}
{{ $hero := .Page.Resources.GetMatch "hero" }}

{{ if $hero }}
{{ $hero := $hero.Resize "1200x" }}

{{- else }}
{{- $hero := .Page.Resources.GetMatch "hero" }}
{{- if $hero }}
{{- $hero := $hero.Resize "1200x" }}
<meta name="og:image" content="{{ $hero.Permalink }}" />
{{ end }}
{{ end }}
{{- end }}
{{- end }}

{{ range default (slice .Params.author) .Params.authors }}
{{ $author := index $.Site.Data.authors . }}
{{ with $author.name }}<meta name="article:author" content="{{ . }}" />{{ end }}
{{ with $author.webfinger }}<meta name="fediverse:creator" content="{{ . }}" />{{ end }}
{{ end }}
{{ end }}
{{- if or (isset .Params "author") (isset .Params "authors") }}
{{- range default (slice .Params.author) .Params.authors }}
{{- $author := index $.Site.Data.authors . }}
{{ with $author.name }}<meta name="article:author" content="{{ . }}" />{{ end }}
{{ with $author.webfinger }}<meta name="fediverse:creator" content="{{ . }}" />{{ end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 4df57c1

Please sign in to comment.