mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-23 21:02:09 +00:00
Add u-syndication, clean up interactions
Add a new "Interactions" section to my pages that contain both Syndication and Webmentions. Make the Syndication links u-syndication. Make both these things children of the <article> h-entry.
This commit is contained in:
parent
5037e399d1
commit
36c049d0ef
8 changed files with 137 additions and 106 deletions
|
@ -6,7 +6,15 @@ replyTitle: "Maintaining a blog is probably the best method I have found to hono
|
||||||
replyType: "SocialMediaPosting"
|
replyType: "SocialMediaPosting"
|
||||||
replyAuthor: "Adrian Rosell"
|
replyAuthor: "Adrian Rosell"
|
||||||
replyAuthorURI: "https://adrianroselli.com/"
|
replyAuthorURI: "https://adrianroselli.com/"
|
||||||
|
syndicatedCopies:
|
||||||
|
- title: 'The Fediverse'
|
||||||
|
url: 'https://pleroma.envs.net/notice/APnxPeFcKz4HvBrckS'
|
||||||
|
- title: 'IndieNews'
|
||||||
|
url: 'https://news.indieweb.org/en'
|
||||||
|
- title: 'IndieForums'
|
||||||
|
url: 'https://www.indieforums.net'
|
||||||
---
|
---
|
||||||
The "Don't Repeat Yourself" (<abbr>DRY</abbr>) principle is my main motivation for adding content to my site---especially to [my "notes" section]({{<relref "/notes">}}). I've gone as far as linking my own website in online class discussions (not as a citation; just for <abbr>DRY</abbr>).
|
The "Don't Repeat Yourself" (<abbr>DRY</abbr>) principle is my main motivation for adding content to my site---especially to [my "notes" section]({{<relref "/notes">}}). I've gone as far as linking my own website in online class discussions (not as a citation; just for <abbr>DRY</abbr>).
|
||||||
|
|
||||||
This also combines really well with the [Publish on your Own Site, Syndicate Elsewhere](https://indieweb.org/POSSE) (<abbr>POSSE</abbr>) principle. Often, a post of mine syndicates well to multiple destinations. I might reply to a forum on my site and syndicate it to both that forum and to the Fediverse. People reply in both places, and Webmentions aggregate them together on my site (though I often have to send myself those mentions). I only have to write something once.
|
This also combines really well with the [Publish on your Own Site, Syndicate Elsewhere](https://indieweb.org/POSSE) (<abbr>POSSE</abbr>) principle. Often, a post of mine syndicates well to multiple destinations. I might reply to a forum on my site and syndicate it to both that forum and to the Fediverse. People reply in both places, and Webmentions aggregate them together on my site (though I often have to send myself those mentions). I only have to write something once.
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||||
<main
|
<main
|
||||||
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/Article" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/Article" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
||||||
|
<article class="h-entry hentry">
|
||||||
{{ partial "full-article.html" . }}
|
{{ partial "full-article.html" . }}
|
||||||
{{ partial "webmentions.html" . }}
|
{{ partial "interact.html" . }}
|
||||||
|
</article>
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
{{- $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||||
<main
|
<main
|
||||||
itemprop="hasPart" itemscope="" itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
itemprop="hasPart" itemscope="" itemtype="https://schema.org/SocialMediaPosting" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
||||||
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />
|
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />
|
||||||
|
<article class="h-entry hentry">
|
||||||
{{ partial "full-article.html" . }}
|
{{ partial "full-article.html" . }}
|
||||||
{{ partial "webmentions.html" . }}
|
{{ partial "interact.html" . }}
|
||||||
|
</article>
|
||||||
</main>
|
</main>
|
||||||
{{ partial "prev-next.html" . -}}
|
{{ partial "prev-next.html" . -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<article class="h-entry hentry"><!--Once WAI-ARIA 1.3 gains traction, I'll add aria-details for webmentions.-->
|
|
||||||
<header>
|
<header>
|
||||||
<h1 itemprop="name headline" class="p-name entry-title" id="h1" tabindex="-1">{{ .Title }}</h1>
|
<h1 itemprop="name headline" class="p-name entry-title" id="h1" tabindex="-1">{{ .Title }}</h1>
|
||||||
{{- if not .Params.disableMeta -}}
|
{{- if not .Params.disableMeta -}}
|
||||||
|
@ -14,4 +13,3 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- partial "processed-content" . -}}
|
{{- partial "processed-content" . -}}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
|
||||||
|
|
7
layouts/partials/interact.html
Normal file
7
layouts/partials/interact.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<hr />
|
||||||
|
<footer aria-labelledby="interact">
|
||||||
|
<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>
|
||||||
|
{{- partial "syndication.html" . -}}
|
||||||
|
{{- partial "webmentions.html" . -}}
|
||||||
|
</footer>
|
15
layouts/partials/syndication.html
Normal file
15
layouts/partials/syndication.html
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{{ with .Params.syndicatedCopies }}
|
||||||
|
<h3>Syndication</h3>
|
||||||
|
<p>This post has been syndicated to:</p>
|
||||||
|
<ul>
|
||||||
|
{{- range . -}}
|
||||||
|
{{- $type := "SocialMediaPosting" -}}
|
||||||
|
{{- with ".type" -}}
|
||||||
|
{{- $type = . -}}
|
||||||
|
{{- end }}
|
||||||
|
<li>
|
||||||
|
<a itemprop="discussionUrl" class="u-syndication" rel="syndication" href="{{ .url }}">{{ .title }}</a>
|
||||||
|
</li>
|
||||||
|
{{- end -}}
|
||||||
|
</ul>
|
||||||
|
{{- end -}}
|
|
@ -4,22 +4,20 @@
|
||||||
{{- range $i, $r := (getCSV "," "/csv/rewrites.csv") -}}
|
{{- range $i, $r := (getCSV "," "/csv/rewrites.csv") -}}
|
||||||
{{- $rewritesDict = merge $rewritesDict (dict (index $r 0) (index $r 1)) -}}
|
{{- $rewritesDict = merge $rewritesDict (dict (index $r 0) (index $r 1)) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<hr />
|
<h3 id="webmentions" tabindex="-1">Web­mentions</h3>
|
||||||
<section aria-labelledby="webmentions" data-nosnippet=""><!--data-nosnippet means this content shouldn't be used for url summaries in search engines.-->
|
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>, a backlink-based alternative to traditional comment forms.</p>
|
||||||
<h2 id="webmentions" tabindex="-1">Web­mentions</h2>
|
{{ partial "webmention-form.html" . }}
|
||||||
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>, a backlink-based alternative to traditional comment forms.</p>
|
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
||||||
{{ partial "webmention-form.html" . }}
|
{{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}
|
||||||
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
|
{{ $webmentions := (getJSON $url1) -}}
|
||||||
{{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}
|
{{- if lt .Date.Unix 1653616670 -}}{{- /* commit c84c8d4 changed my URL schemes, so fetch menchies for the legacy scheme on old posts. */ -}}
|
||||||
{{ $webmentions := (getJSON $url1) -}}
|
|
||||||
{{- if lt .Date.Unix 1653616670 -}}{{- /* commit c84c8d4 changed my URL schemes, so fetch menchies for the legacy scheme on old posts. */ -}}
|
|
||||||
{{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}}
|
{{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}}
|
||||||
{{- $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}}
|
{{- $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}}
|
||||||
{{- $webmentions = $webmentions | append (getJSON $url2) -}}
|
{{- $webmentions = $webmentions | append (getJSON $url2) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if gt (len $webmentions) 0 -}}
|
{{- if gt (len $webmentions) 0 -}}
|
||||||
<p>Webmentions received for this post appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don’t support them. I auto-replace broken links with <a href="https://web.archive.org/">Wayback Machine</a> snapshots, if they exist.</p>
|
<p>Webmentions received for this post appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don’t support them. I auto-replace broken links with <a href="https://web.archive.org/">Wayback Machine</a> snapshots, if they exist.</p>
|
||||||
<details>
|
<details>
|
||||||
<summary>Toggle Webmentions</summary>
|
<summary>Toggle Webmentions</summary>
|
||||||
<dl>
|
<dl>
|
||||||
{{ range sort $webmentions "created_at" -}}
|
{{ range sort $webmentions "created_at" -}}
|
||||||
|
@ -98,9 +96,8 @@
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</dl>
|
</dl>
|
||||||
</details>
|
</details>
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
<p>This post does not have any approved Webmentions yet.</p>
|
<p>This post does not have any approved Webmentions yet.</p>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<p>Feel free to contact me directly with feedback; <a href="{{ .Site.BaseURL }}about/#location-seirdy-online">here’s my contact info</a></p>
|
<p>Feel free to contact me directly with feedback; <a href="{{ .Site.BaseURL }}about/#location-seirdy-online">here’s my contact info</a></p>
|
||||||
</section>
|
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
{{- .Scratch.Set "codeIndex" 1 -}}
|
{{- .Scratch.Set "codeIndex" 1 -}}
|
||||||
<main
|
<main
|
||||||
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
itemprop="mainEntity" itemscope="" itemtype="https://schema.org/BlogPosting{{ with .Params.articleType }} https://schema.org/{{ . }}{{ end }}" itemid="{{ .Site.Params.CanonicalBaseURL }}{{ $canonicalRelPermalink }}">
|
||||||
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />
|
<link itemprop="isPartOf" href="{{ .Site.Params.CanonicalBaseURL }}/" />
|
||||||
|
<article class="h-entry hentry">
|
||||||
{{ partial "full-article.html" . }}
|
{{ partial "full-article.html" . }}
|
||||||
{{ partial "webmentions.html" . }}
|
{{ partial "interact.html" . }}
|
||||||
|
</article>
|
||||||
</main>
|
</main>
|
||||||
{{ partial "prev-next.html" . -}}
|
{{ partial "prev-next.html" . -}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue