mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00

- delete unused script tags from the webmentions partial template - cleanup improves readability and reduces clutter
54 lines
2 KiB
HTML
54 lines
2 KiB
HTML
{# 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) | safe }}"
|
|
{{ script_data }}
|
|
>
|
|
</script>
|
|
|