mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
More caching of partials (+ fix a typo)
This commit is contained in:
parent
fb33951b8f
commit
2796526310
6 changed files with 9 additions and 13 deletions
|
@ -2,7 +2,7 @@
|
||||||
<footer>
|
<footer>
|
||||||
{{ partial "breadcrumblist.html" . }}
|
{{ partial "breadcrumblist.html" . }}
|
||||||
<p>
|
<p>
|
||||||
Copyright <time itemprop="copyrightYear" datetime="{{now.Year}}">{{now.Year}}</time> {{ partial "indieweb-author.html" -}}
|
Copyright <time itemprop="copyrightYear" datetime="{{now.Year}}">{{now.Year}}</time> {{ partialCached "indieweb-author.html" . -}}
|
||||||
</p>
|
</p>
|
||||||
<nav aria-label="site info">
|
<nav aria-label="site info">
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
<footer>
|
<footer>
|
||||||
<h2 id="interact" tabindex="-1">Interact</h2>
|
<h2 id="interact" tabindex="-1">Interact</h2>
|
||||||
<p>You can interact by <a href="#webmentions">sending webmentions</a> or by visiting a syndicated copy of this post.</p>
|
<p>You can interact by <a href="#webmentions">sending webmentions</a> or by visiting a syndicated copy of this post.</p>
|
||||||
|
{{ with .Params.syndicatedCopies }}
|
||||||
{{- partial "syndication.html" . -}}
|
{{- partial "syndication.html" . -}}
|
||||||
|
{{- end -}}
|
||||||
{{- partial "webmentions/webmentions.html" . -}}
|
{{- partial "webmentions/webmentions.html" . -}}
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<p>
|
<p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ if $needsList }}<li>{{ end }}
|
{{ if $needsList }}<li>{{ end }}
|
||||||
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.UTC.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.UTC.Format "2006-01-02" }}</time> by {{ partial "indieweb-author.html" -}}{{ if not $shortMeta }} on his <a rel="canonical" itemprop="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="{{ $gemini }}">Gemini capsule</a>{{ end }}{{- end -}}.
|
{{- $action }} <time{{ if not (.Params.evergreen) }} itemprop="dateCreated datePublished" class="dt-published published"{{ end }} datetime="{{ .Date.UTC.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.UTC.Format "2006-01-02" }}</time> by {{ partialCached "indieweb-author.html" . -}}{{ if not $shortMeta }} on his <a rel="canonical" itemprop="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="{{ $gemini }}">Gemini capsule</a>{{ end }}{{- end -}}.
|
||||||
{{ if $needsList }}</li>{{ end }}
|
{{ if $needsList }}</li>{{ end }}
|
||||||
{{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
|
{{- if gt (sub .Lastmod.Unix .Date.Unix) 900 -}}
|
||||||
{{ if $needsList }}<li>{{ end }}
|
{{ if $needsList }}<li>{{ end }}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
{{ with .Params.syndicatedCopies }}
|
|
||||||
<h3>Syndication</h3>
|
<h3>Syndication</h3>
|
||||||
<p>This post has been syndicated to:</p>
|
<p>This post has been syndicated to:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -12,4 +11,3 @@
|
||||||
</li>
|
</li>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</ul>
|
</ul>
|
||||||
{{- end -}}
|
|
||||||
|
|
|
@ -13,14 +13,10 @@
|
||||||
{{- /* We can't just use a simple "where" function because we need to ignore URL anchors/query-params when making a comparison: https://discourse.gohugo.io/t/add-like-comparison-operator-to-the-where-function/42013/4 */ -}}
|
{{- /* We can't just use a simple "where" function because we need to ignore URL anchors/query-params when making a comparison: https://discourse.gohugo.io/t/add-like-comparison-operator-to-the-where-function/42013/4 */ -}}
|
||||||
{{- $webmentions := slice -}}
|
{{- $webmentions := slice -}}
|
||||||
{{- range partialCached "webmentions/all-webmentions.html" . -}}
|
{{- range partialCached "webmentions/all-webmentions.html" . -}}
|
||||||
{{- if in $targets .target -}}
|
{{- $u := urls.Parse .target -}}
|
||||||
|
{{- $trimmedTarget := printf `https://%s%s` $u.Hostname $u.Path -}}
|
||||||
|
{{- if in $targets $trimmedTarget -}}
|
||||||
{{ $webmentions = $webmentions | append . }}
|
{{ $webmentions = $webmentions | append . }}
|
||||||
{{- else -}}
|
|
||||||
{{- $u := urls.Parse .target -}}
|
|
||||||
{{- $trimmedTarget := printf `https://%s%s` $u.Hostname $u.Path -}}
|
|
||||||
{{- if in $targets $trimmedTarget -}}
|
|
||||||
{{ $webmentions = $webmentions | append . }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- /* Render webmentions if they exist */ -}}
|
{{- /* Render webmentions if they exist */ -}}
|
||||||
|
@ -40,7 +36,7 @@
|
||||||
{{- if findRE "@Seirdy" $webmention.title -}}
|
{{- if findRE "@Seirdy" $webmention.title -}}
|
||||||
{{- $title = $title | replaceRE `^@Seirdy@pleroma.envs.net(\n| )?` "" -}}
|
{{- $title = $title | replaceRE `^@Seirdy@pleroma.envs.net(\n| )?` "" -}}
|
||||||
{{- /* Mastodon webmentions may include the author in the title followed by a colon; this is redundant. */ -}}
|
{{- /* Mastodon webmentions may include the author in the title followed by a colon; this is redundant. */ -}}
|
||||||
{{- if and (isset $webmention "author_name") (findRE `@` $webmention.source) (not (findRE "^https://bridg.gy" $webmention.source)) -}}
|
{{- if and (isset $webmention "author_name") (findRE `@` $webmention.source) (not (findRE "^https://brid.gy" $webmention.source)) -}}
|
||||||
{{ $title = $title | replaceRE `^[^:]{0,20}: ?` "" | replaceRE `^"@Seirdy@pleroma.envs.net ?` `"` }}
|
{{ $title = $title | replaceRE `^[^:]{0,20}: ?` "" | replaceRE `^"@Seirdy@pleroma.envs.net ?` `"` }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
(btw this is all made of <span> cuz it is supposed to be inline)
|
(btw this is all made of <span> cuz it is supposed to be inline)
|
||||||
--><span itemprop="author copyrightHolder" itemscope="" itemtype="https://schema.org/Person" itemid="https://seirdy.one/#seirdy" class="h-card p-author author vcard">
|
--><span itemprop="author copyrightHolder" itemscope="" itemtype="https://schema.org/Person" itemid="https://seirdy.one/#seirdy" class="h-card p-author author vcard">
|
||||||
<a itemprop="url" href="https://seirdy.one/" rel="author me home cc:attributionURL" class="u-url u-uid url" property="cc:attributionName">
|
<a itemprop="url" href="https://seirdy.one/" rel="author me home cc:attributionURL" class="u-url u-uid url" property="cc:attributionName">
|
||||||
{{ partial "indieweb-icon.html" -}} <span itemprop="name" class="p-name fn n">
|
{{ partialCached "indieweb-icon.html" . -}} <span itemprop="name" class="p-name fn n">
|
||||||
<span itemprop="givenName" class="p-given-name given-name">Rohan</span> “<span itemprop="additionalName" class="p-additional-name additional-name">Seirdy</span>” <span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
|
<span itemprop="givenName" class="p-given-name given-name">Rohan</span> “<span itemprop="additionalName" class="p-additional-name additional-name">Seirdy</span>” <span itemprop="familyName" class="p-family-name family-name">Kumar</span></span></a>
|
||||||
</span>{{- /* no line break */ -}}
|
</span>{{- /* no line break */ -}}
|
||||||
|
|
Loading…
Reference in a new issue