1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Add Open Graph metas for article posted/mod times

This commit is contained in:
Rohan Kumar 2021-02-24 19:36:09 -08:00
parent 76efbb8479
commit e8179a38b9
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 7 additions and 3 deletions

View file

@ -57,5 +57,10 @@
<meta property="og:image:width" content="1200">
<meta property="og:url" content="https://seirdy.one{{ .RelPermalink }}">
<meta property="og:description" content="{{ if .Params.description }}{{ .Params.description }}{{ else }}{{ .Site.Params.Description }}{{ end }}">
<meta property="article:author" content="{{ .Site.Author.name }}">
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ if lt .Date .Lastmod -}}
<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">
{{ end -}}
{{ hugo.Generator }}
</head>

View file

@ -3,14 +3,13 @@
<article itemprop="mainEntityOfPage">
<header id="post-header">
<h1 itemprop="name headline" class="p-name">{{ .Title }}</h1>
{{ $lastmod := .Lastmod -}}
{{ if lt .Date $lastmod -}}
{{ if lt .Date .Lastmod -}}
Posted <time class="dt-published" itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> by {{- partial "indieweb-author.html" -}} on his <a class="u-url" href="https://seirdy.one{{ .RelPermalink }}">Website</a>
{{- with .OutputFormats.Get "gemtext" }}
and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>
{{- end -}}
<br>
Last updated <time itemprop="dateModified" class="dt-updated" datetime="{{ $lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ .Site.Params.logUrlPrefix }}content/{{ .File.Path }}">Changelog</a>
Last updated <time itemprop="dateModified" class="dt-updated" datetime="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>. <a href="{{ .Site.Params.logUrlPrefix }}content/{{ .File.Path }}">Changelog</a>
{{ else -}}
Posted <a class="u-url" href="https://seirdy.one{{ .RelPermalink }}"><time itemprop="datePublished" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time></a> by {{- partial "indieweb-author.html" -}} on his <a class="u-url" href="https://seirdy.one{{ .RelPermalink }}">Website</a>
{{- with .OutputFormats.Get "gemtext" }}