Add page metadata

This commit is contained in:
Gabriel Arazas 2022-05-01 20:38:52 +08:00
parent f00d93890d
commit 0e467e5595
2 changed files with 4 additions and 3 deletions

View File

@ -4,14 +4,14 @@
*/ -}} */ -}}
<div class="list post__meta"> <div class="list post__meta">
{{- if ne (.PublishDate.Format "2006") "0001" -}} {{- if ne (.PublishDate.Format "2006") "0001" -}}
<time datetime="{{ .PublishDate }}"> <time datetime="{{ .PublishDate }}" title="{{ i18n "published_on" }}">
{{ partial "components/heroicon.html" "calendar" }} {{ partial "components/heroicon.html" "calendar" }}
<span style="margin-left: 0.5em;">{{ .PublishDate.Format "2006-01-02" }}</span> <span style="margin-left: 0.5em;">{{ .PublishDate.Format "2006-01-02" }}</span>
</time> </time>
{{- end }} {{- end }}
{{- if and .GitInfo (ne (.PublishDate.Format "2006-01-02") (.Lastmod.Format "2006-01-02")) }} {{- if and .GitInfo (ne (.PublishDate.Format "2006-01-02") (.Lastmod.Format "2006-01-02")) }}
<time datetime="{{ .Lastmod }}"> <time datetime="{{ .Lastmod }}" title="{{ i18n "updated_on" }}">
{{ partial "components/heroicon.html" "refresh" }} {{ partial "components/heroicon.html" "refresh" }}
<span style="margin-left: 0.5em;">{{ .Lastmod.Format "2006-01-02" }}</span> <span style="margin-left: 0.5em;">{{ .Lastmod.Format "2006-01-02" }}</span>
</time> </time>
@ -22,7 +22,7 @@
{{- $names := slice }} {{- $names := slice }}
{{- range . }}{{ $names = $names | append .name }}{{ end }} {{- range . }}{{ $names = $names | append .name }}{{ end }}
{{- $author := index (first 1 $names) 0 }} {{- $author := index (first 1 $names) 0 }}
<span data-authors="{{ jsonify $names }}"> <span data-authors="{{ jsonify $names }}" title="{{ i18n "published_by" }}">
{{ partial "components/heroicon.html" "pencil" }} {{ partial "components/heroicon.html" "pencil" }}
<span style="margin-left: 0.5em;"> <span style="margin-left: 0.5em;">
{{ $author }}{{ if ge (len .) 2 }}, et al.{{ end }} {{ $author }}{{ if ge (len .) 2 }}, et al.{{ end }}

View File

@ -35,6 +35,7 @@
<meta name="description" content="{{ if (and (eq .Kind "home") .IsHome) }}{{ .Site.Title }}{{ else }}{{ .Summary | safeHTML }}{{ end }}" /> <meta name="description" content="{{ if (and (eq .Kind "home") .IsHome) }}{{ .Site.Title }}{{ else }}{{ .Summary | safeHTML }}{{ end }}" />
{{- template "_internal/twitter_cards.html" . }} {{- template "_internal/twitter_cards.html" . }}
{{- template "_internal/opengraph.html" . }} {{- template "_internal/opengraph.html" . }}
{{- template "_internal/schema.html" . }}
{{- /* Linking all of the output formats for discovery. */ -}} {{- /* Linking all of the output formats for discovery. */ -}}