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

Add webmention submission forms

A long time coming
This commit is contained in:
Rohan Kumar 2022-05-29 22:48:27 -07:00
parent c82cd646dc
commit 0ed68c5e9a
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
4 changed files with 21 additions and 6 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

@ -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,6 +1,7 @@
<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" -}}