summaryrefslogtreecommitdiff
path: root/templates/partials/webmentions.html
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2025-09-13 14:55:15 -0600
committerAlejandro Soto <alejandro@34project.org>2025-09-13 14:55:15 -0600
commita2ea06d513a5802964f8f0ef5795cec7e548ed7b (patch)
tree8afb58e3749d19bc46cffc6473f3059d647c515b /templates/partials/webmentions.html
Squashed 'themes/tabi-lean/' content from commit 95c8796
git-subtree-dir: themes/tabi-lean git-subtree-split: 95c879696445ede40daa7a30a88dae5dd74d5c0c
Diffstat (limited to 'templates/partials/webmentions.html')
-rw-r--r--templates/partials/webmentions.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/templates/partials/webmentions.html b/templates/partials/webmentions.html
new file mode 100644
index 0000000..e579a04
--- /dev/null
+++ b/templates/partials/webmentions.html
@@ -0,0 +1,51 @@
+{# Incorporate webmention.io links and script into the page head.
+1. Provide the link to the webmention data in the at webmention.io.
+2. Link to the stylesheet for styling webmentions on a page.
+3. Add and configure the javascript to fetch and display the webmentions collected at webmention.io. #}
+
+<link rel="webmention" href="https://webmention.io/{{ config.extra.webmentions.domain }}/webmention" />
+
+{# Calculate the configured data for the script, if any #}
+
+{% set script_data = "" %}
+
+{% if config.extra.webmentions.id %}
+{% set script_data = script_data ~ "data-id=" ~ config.extra.webmentions.id %}
+{% endif %}
+
+{% if config.extra.webmentions.page_url %}
+{% set script_data = script_data ~ " data-page-url=" ~ config.extra.webmentions.page_url %}
+{% endif %}
+
+{% if config.extra.webmentions.add_urls %}
+{% set script_data = script_data ~ "data-add-urls=" ~ config.extra.webmentions.add_urls %}
+{% endif %}
+
+{% if config.extra.webmentions.wordcount %}
+{% set script_data = script_data ~ " data-wordcount=" ~ config.extra.webmentions.wordcount %}
+{% endif %}
+
+{% if config.extra.webmentions.max_webmentions %}
+{% set script_data = script_data ~ "data-max-webmentions=" ~ config.extra.webmentions.max_webmentions %}
+{% endif %}
+
+{% if config.extra.webmentions.prevent_spoofing %}
+{% set script_data = script_data ~ "data-prevent-spoofing=" ~ config.extra.webmentions.prevent_spoofing %}
+{% endif %}
+
+{% if config.extra.webmentions.sort_by %}
+{% set script_data = script_data ~ "data-sort-by=" ~ config.extra.webmentions.sort_by %}
+{% endif %}
+
+{% if config.extra.webmentions.sort_dir %}
+{% set script_data = script_data ~ "data-sort-dir=" ~ config.extra.webmentions.sort_dir %}
+{% endif %}
+
+{% if config.extra.webmentions.comments_are_reactions %}
+{% set script_data = script_data ~ " data-comments-are-reactions=" ~ config.extra.webmentions.comments_are_reactions %}
+{% endif %}
+
+<script async src="{{ get_url(path='js/webmention.min.js', trailing_slash=false, cachebust=true) | safe }}" {{ script_data }}>
+</script>
+
+<div class="webmentions-container" id="webmentions"></div>