1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Compare commits

..

3 commits

Author SHA1 Message Date
Rohan Kumar
0ed68c5e9a
Add webmention submission forms
A long time coming
2022-05-29 22:48:27 -07:00
Rohan Kumar
c82cd646dc
Poggies. 2022-05-29 22:06:03 -07:00
Rohan Kumar
65306b7867
Fix: sort webmentions by date 2022-05-29 20:37:18 -07:00
6 changed files with 26 additions and 7 deletions

View file

@ -186,18 +186,18 @@ nav ul li {
* single-row flexbox that supports more browsers. Kanged this CSS from
* ww.gov.uk. Give the entire width of the row to the search box, but
* allow the minimum width for the submit button. */
form {
form > div {
display: table;
width: 100%
}
/* A text box should not look like a button */
input[type="search"] {
input:not([type="submit"]) {
display: table-cell;
width: 98%;
}
form > div {
form > div > div {
display: table-cell;
vertical-align: top; /* IE and some botique browsers need this */
width: 1%;

View file

@ -62,3 +62,5 @@ I don't collect anything except default server logs, purged regularly. More deta
=> gemini://seirdy.one/privacy/
Poggies.

View file

@ -50,6 +50,8 @@ If you find a "Seirdy" somewhere else and don't know whether or not it's me, ple
My preferred forge for personal projects is Sourcehut, but my repositories have remotes for GitHub, GitLab, and Codeberg too.
<small>Poggies</small>
Selected projects
-----------------

View file

@ -1,7 +1,9 @@
<span id="search-label">Search this site:</span>
<form
itemprop="potentialAction" itemscope itemtype="https://schema.org/SearchAction"
action="https://searchmysite.net/search/" method="get">
<input aria-labelledby="search-label" itemprop="query" type="search" value="domain:seirdy.one " name="q">
<div><input type="submit" value="search"></div>
<label for="search">Search this site:</label>
<div><!--We need the extra divs to serve as pseudo-table-cells.-->
<input id="search" itemprop="query" type="search" value="domain:seirdy.one " name="q">
<div><input type="submit" value="search"></div>
</div>
</form>

View file

@ -0,0 +1,12 @@
<form
itemprop="potentialAction" itemscope itemtype="https://schema.org/CommentAction"
action="https://seirdy.one/webmentions/receive" method="post">
<meta itemprop="actionStatus" content="PotentialActionStatus">
<label for="menchie">Publish a response on your own website and share the link here to send me a webmention! Include a link to this page's canonical location for it to be accepted.</label>
{{ $canonicalRelPermalink := .RelPermalink | replaceRE "^/~seirdy/" "/" -}}
<input type="hidden" name="target" value="{{ .Site.Params.canonicalBaseURL }}{{ $canonicalRelPermalink }}">
<div><!--We need the extra divs to serve as pseudo-table-cells.-->
<input id="menchie" type="url" name="source">
<div><input type="submit" value="submit"></div>
</div>
</form>

View file

@ -1,13 +1,14 @@
<section aria-labelledby="webmentions">
<h2 id="webmentions" tabindex="-1">Webmen&shy;tions</h2>
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>. Webmentions received for this post will 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. Check the <a href="https://web.archive.org/">Wayback Machine</a> if any links are broken.</p>
{{ partial "webmention-form.html" }}
<dl>
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}}
{{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}
{{ $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}}
{{ $webmentions := (getJSON $url1) | append (getJSON $url2) -}}
{{ range $webmentions -}}
{{ range sort $webmentions "created_at" -}}
{{ $webmention := . -}}
{{ if (eq $webmention.type "like") -}}
<div itemprop="potentialAction" itemscope itemtype="https://schema.org/LikeAction" class="u-like h-cite">