1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-14 01:32:11 +00:00

Support "evergreen" articles

"evergreen" articles don't get outdated and shouldn't be marked with a
published date in previews.
This commit is contained in:
Rohan Kumar 2022-05-23 08:39:24 -07:00
parent e430cedff2
commit 279d70810e
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
4 changed files with 4 additions and 3 deletions

View file

@ -10,6 +10,7 @@ sitemap:
ChangeFreq: weekly ChangeFreq: weekly
Priority: 0.7 Priority: 0.7
footnote_heading: Notes footnote_heading: Notes
evergreen: true
featured: 1 featured: 1
title: A look at search engines with their own indexes title: A look at search engines with their own indexes
--- ---

View file

@ -20,7 +20,7 @@
<meta name="description" content="{{ $description }}"> <meta name="description" content="{{ $description }}">
<meta name="author" content="{{ .Site.Author.name }}"> <meta name="author" content="{{ .Site.Author.name }}">
<meta property="article:author" content="{{ .Site.Author.name }}"> <meta property="article:author" content="{{ .Site.Author.name }}">
{{ if gt .Date 0 -}} {{ if and (gt .Date 0) (not .Params.evergreen) -}}
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}"> <meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ end -}} {{ end -}}
{{ if lt .Date .Lastmod -}} {{ if lt .Date .Lastmod -}}

View file

@ -1,6 +1,6 @@
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }} {{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path }} {{- $logURL := printf "%scontent/%s" .Site.Params.logUrlPrefix .File.Path }}
Posted <time itemprop="dateCreated datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time> Posted <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>
by {{- partial "indieweb-author.html" -}} on his <a rel="canonical" itemprop="mainEntityOfPage url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{- end -}}. by {{- partial "indieweb-author.html" -}} on his <a rel="canonical" itemprop="mainEntityOfPage url" class="u-url url" href="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">Website</a>{{- with .OutputFormats.Get "gemtext" -}}{{- printf " " -}}and <a rel="syndication" class="u-syndication" href="{{replace .Permalink "/gemini" "" 1 | safeURL}}">Gemini capsule</a>{{- end -}}.
{{ if lt .Date .Lastmod -}} {{ if lt .Date .Lastmod -}}
<br> <br>

View file

@ -39,7 +39,7 @@
</h3> </h3>
{{- end }} {{- end }}
Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>, updated Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02" }}</time>, updated
<time itemprop="dateModified" class="dt-updated updated" datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time> <time{{ if not (.Params.evergreen) }} itemprop="dateModified" class="dt-updated updated"{{ end }} datetime="{{ .Lastmod.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Lastmod.Format "2006-01-02" }}</time>
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p> <p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p> <p>{{- partial "wordcount.html" . -}}</p>
</article> </article>