website-theme/layouts/partials/webmentions.html
2024-10-29 12:02:03 -04:00

13 lines
767 B
HTML

<!-- Webmentions -->
<div class="noprint" id="webmentions"></div>
{{ $siteHost := (urls.Parse .Site.BaseURL).Host -}}
<form class="noprint" method="post" action="https://webmention.io/{{ $siteHost }}/webmention">
<p style="display: inline-block;">Published a response to this? <label for="webmention-source">Let me know the URL</label>:</p>
<input type="url" name="source" id="webmention-source">
<input type="hidden" name="target" value="{{ .Permalink }}">
<button type="submit">Submit</button>
</form>
</main>
{{ $webmentionjs := resources.Get "js/webmention.min.js" }}
{{ $aliasesCombined := delimit (apply .Aliases "absURL" ".") "|" }}
<script src="{{ $webmentionjs.Permalink }}" {{ printf "add-urls=%s" $aliasesCombined | safeHTMLAttr }} async></script>