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

Switch archives to proper Hugo "list" template

This commit is contained in:
Rohan Kumar 2022-06-19 14:21:40 -07:00
parent 626f9cd886
commit 9b3373701d
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
4 changed files with 47 additions and 41 deletions

View file

@ -6,3 +6,7 @@ sitemap:
ChangeFreq: daily ChangeFreq: daily
Priority: 0.8 Priority: 0.8
--- ---
Notes
=====
This is my microblog, containing short informal entries. [See my blog](../posts/) for longer entries. An [An Atom feed](./atom.xml) contains the full text of all my notes. If that has any problems, I also have [a legacy RSS feed](./index.xml).

View file

@ -6,3 +6,8 @@ sitemap:
ChangeFreq: weekly ChangeFreq: weekly
Priority: 0.7 Priority: 0.7
--- ---
Posts
=====
These are all of my long-form posts. [An Atom feed](./atom.xml) contains their full text. If that has any problems, I also have [a legacy RSS feed](./index.xml).

View file

@ -1,7 +1,40 @@
{{ define "main" -}} {{ define "main" -}}
{{- if eq .Page.Section "notes" -}} <main itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/DataFeed">
{{- partial "notes.html" . -}} {{ partial "processed-content.html" . }}
{{- else -}} <p role="doc-tip">
{{- partial "posts.html" . -}} Timestamp format: <code>YYYY-MM-DD HH:MM</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite>. Sorted newest to oldest.
</p>
<ol>
{{- $pages := (where site.RegularPages "Section" .Section) -}}
{{- range $pages -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
<li itemprop="dataFeedElement" itemscope="" itemtype="https://schema.org/DataFeedItem">
<article class="h-entry hentry" itemprop="item" itemscope="" itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<h2 itemprop="name headline" class="p-name entry-title">
<a href="{{ .Permalink }}" itemprop="url" class="u-url url" rel="bookmark">
{{ .Title }}
</a>
</h2>
<p>
Posted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02 15:04" }}</time>
{{- if gt (sub .Lastmod.Unix .Date.Unix) 3600 -}}
, updated <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 15:04" }}</time>
{{- end }}
</p>
{{- if eq .Section "notes" }}
<div class="e-content entry-content" itemprop="articleBody">
{{- if .Params.replyURI -}}
{{- partial "reply-context" .Params -}}
{{- end -}} {{- end -}}
{{ partial "processed-content.html" . }}
</div>
{{- else }}
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
<p>{{- partial "wordcount.html" . -}}</p>
{{- end }}
</article>
</li>
{{- end }}
</ol>
</main>
{{ end }} {{ end }}

View file

@ -1,36 +0,0 @@
{{ define "main" -}}
<main itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/DataFeed">
<h1 class="p-name" itemprop="name headline" id="notes">Notes</h1>
<p>This is my microblog, containing short informal entries. <a href="../posts/">See my blog</a> for longer entries. An <a href="./atom.xml">An Atom feed</a> contains the full text of all my notes. If that has any problems, I also have <a href="./index.xml">a legacy RSS feed</a>.</p>
<p role="doc-tip">
Timestamp format: <code>YYYY-MM-DD HH:MM:SS</code>, as per <cite><a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</a></cite>. Sorted newest to oldest.
</p>
<ol>
{{- $posts := (where site.RegularPages "Section" "notes") -}}
{{- range $posts -}}
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
<li itemprop="dataFeedElement" itemscope="" itemtype="https://schema.org/DataFeedItem">
<article class="h-entry hentry" itemprop="item" itemscope="" itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
<h2 itemprop="name headline" class="p-name entry-title">
<a href="{{ .Permalink }}" itemprop="url" class="u-url url" rel="bookmark">
{{ .Title }}
</a>
</h2>
<p>
Noted <time itemprop="datePublished" class="dt-published published" datetime="{{ .Date.Format "2006-01-02 15:04:05Z07:00" }}">{{ .Date.Format "2006-01-02 15:04:05" }}</time>
{{- if gt (sub .Lastmod.Unix .Date.Unix) 3600 -}}
, updated <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 15:04:05" }}</time>
{{- end }}
</p>
<div class="e-content entry-content" itemprop="articleBody">
{{- if .Params.replyURI -}}
{{- partial "reply-context" .Params -}}
{{- end -}}
{{ partial "processed-content.html" . }}
</div>
</article>
</li>
{{- end }}
</ol>
</main>
{{ end }}