mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-30 15:22:09 +00:00
19d5fe2b00
Use partialCached to avoid any perf penalty. TODO: limit the scope I pass to them. I noticed a teeny tiny perf improvement after doing this, probably because now some giant data structures only need to be generated once.
45 lines
1.8 KiB
HTML
45 lines
1.8 KiB
HTML
{{ define "main" -}}
|
|
<main
|
|
itemprop="mainEntity" class="h-feed hfeed" itemscope="" itemtype="https://schema.org/DataFeed">
|
|
{{ partial "processed-content.html" . }}
|
|
<p role="doc-tip">
|
|
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/" "/" -}}
|
|
{{- $isTall := and (eq .Section "notes") (gt .WordCount 200) -}}
|
|
{{- $itemtype := "SocialMediaPosting" -}}
|
|
{{- if eq .Section "posts" -}}
|
|
{{- $itemtype = "BlogPosting" -}}
|
|
{{- end -}}
|
|
<li itemprop="dataFeedElement" itemscope="" itemtype="https://schema.org/DataFeedItem">
|
|
<article
|
|
class="h-entry hentry{{ with $isTall }} tall{{ end }}"
|
|
itemprop="item" itemscope="" itemtype="https://schema.org/{{ $itemtype }}" 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>
|
|
{{- .Scratch.Set "shortMeta" true -}}
|
|
{{- partial "post-meta/post-meta.html" . }}
|
|
{{- if eq .Section "notes" }}
|
|
<div class="e-content entry-content" itemprop="articleBody">
|
|
{{- if .Params.replyURI -}}
|
|
{{- partial "reply-context" .Params -}}
|
|
{{- end -}}
|
|
{{ partial "processed-content.html" . }}
|
|
</div>
|
|
{{- else }}
|
|
<div><!--Keep this attr-free div to make this part structurally identical.-->
|
|
<p class="p-summary entry-summary" itemprop="description">{{ .Description }}</p>
|
|
</div>
|
|
{{- end }}
|
|
</article>
|
|
</li>
|
|
{{- end }}
|
|
</ol>
|
|
</main>
|
|
{{ end }}
|