From 4f6b64129a1d507ca3ae2c1d0bb5e09eb695c2cc Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 11 Feb 2025 22:36:50 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=92=84=20style(theme):=20comment=20ou?= =?UTF-8?q?t=20page=5Furl=20setting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - comment out page_url to prevent its usage and rely on default behavior --- theme.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme.toml b/theme.toml index 417323f..d3a3459 100644 --- a/theme.toml +++ b/theme.toml @@ -332,7 +332,7 @@ custom_subset = true # data configuration for the webmention.min.js script # The base URL to use for this page. Defaults to window.location -page_url = "https://beesbuzz.biz/code/439-Falsehoods-programmers-believe-about-email" +# page_url = "https://beesbuzz.biz/code/439-Falsehoods-programmers-believe-about-email" # Additional URLs to check, separated by |s # add_urls From a663de6dacaa6010507beae661bf50545bac6269 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 12 Feb 2025 13:01:04 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=A8=20feat(csp):=20add=20webmention?= =?UTF-8?q?=20support=20to=20content=20security=20policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - include webmention.io in connect-src when webmention system is enabled - ensure compatibility with webmention services by updating CSP directives --- templates/partials/content_security_policy.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/partials/content_security_policy.html b/templates/partials/content_security_policy.html index ee9211c..187060d 100644 --- a/templates/partials/content_security_policy.html +++ b/templates/partials/content_security_policy.html @@ -54,6 +54,12 @@ content="default-src 'self' {%- set script_src = script_src ~ " " ~ " cdn.jsdelivr.net" -%} {%- endif -%} + {#- Check if a webmention system is enabled to allow the necessary domains and directives -#} + {%- set webmention_enabled = config.extra.webmentions.enabled -%} + {%- if webmention_enabled -%} + {%- set connect_src = connect_src ~ " webmention.io" -%} + {%- endif -%} + {#- Append WebSocket for Zola serve mode -#} {%- if config.mode == "serve" -%} {%- set connect_src = connect_src ~ " ws:" -%} From afbf2aa2ff9df97e86366a16d5eb0ba1b8e9369d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 12 Feb 2025 13:01:26 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=90=9B=20fix(config):=20update=20webm?= =?UTF-8?q?entions=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - change "enable" to "enabled" for correct configuration key - uncomment and set webmentions configurations for correct functionality ✨ feat(blog): add webmentions shortcode - insert webmentions shortcode in blog shortcode index for display 🐛 fix(theme): update webmentions configuration in theme - change "enable" to "enabled" for correct configuration key in theme - uncomment and set webmentions configurations for correct functionality --- config.toml | 7 +++---- content/blog/shortcodes/index.md | 2 ++ templates/partials/header.html | 2 +- theme.toml | 5 ++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config.toml b/config.toml index 533c1c0..2172b28 100644 --- a/config.toml +++ b/config.toml @@ -328,7 +328,6 @@ allowed_domains = [ { directive = "script-src", domains = ["'self'"] }, { directive = "style-src", domains = ["'self'"] }, { directive = "frame-src", domains = ["player.vimeo.com", "https://www.youtube-nocookie.com"] }, -# { directive = "connect-src", domains = [ "https://webmention.io"] }, ] # Enable the CSP directives configured (or default). @@ -365,9 +364,9 @@ service = "goatcounter" self_hosted_url = "https://tabi-stats.osc.garden" [extra.webmentions] -# enable = true +enabled = true # Specify the domain registered with webmention.io. -# domain = "www.example.com" +domain = "www.example.com" # The HTML ID for the object to fill in with the webmention data. # Defaults to "webmentions" @@ -381,7 +380,7 @@ page_url = "https://beesbuzz.biz/code/439-Falsehoods-programmers-believe-about-e # add_urls # The maximum number of words to render in reply mentions. -# wordcount = 20 +wordcount = 20 # The maximum number of mentions to retrieve. Defaults to 30. # max_webmentions diff --git a/content/blog/shortcodes/index.md b/content/blog/shortcodes/index.md index f65a9c5..5d115a3 100644 --- a/content/blog/shortcodes/index.md +++ b/content/blog/shortcodes/index.md @@ -466,5 +466,7 @@ Add the shortcut on the page where you want to display the webmentions: {{/* webmentions() */}} ``` +{{ webmentions() }} + [1]: https://www.w3.org/TR/webmention/#abstract-p-1 [2]: https://webmention.io/ diff --git a/templates/partials/header.html b/templates/partials/header.html index f4c43f1..f93de97 100644 --- a/templates/partials/header.html +++ b/templates/partials/header.html @@ -154,7 +154,7 @@ {%- endif -%} {# Webmentions #} - {%- if config.extra.webmentions.enable -%} + {%- if config.extra.webmentions.enabled -%} {%- include "partials/webmentions.html" -%} {%- endif -%} diff --git a/theme.toml b/theme.toml index d3a3459..fdd3572 100644 --- a/theme.toml +++ b/theme.toml @@ -285,7 +285,6 @@ allowed_domains = [ { directive = "script-src", domains = ["'self'"] }, { directive = "style-src", domains = ["'self'"] }, { directive = "frame-src", domains = ["player.vimeo.com", "https://www.youtube-nocookie.com"] }, -# { directive = "connect-src", domains = [ "https://webmention.io"] }, ] # Enable the CSP directives configured (or default). @@ -322,7 +321,7 @@ custom_subset = true # self_hosted_url = "" [extra.webmentions] -# enable = true +# enabled = true # Specify the domain registered with webmention.io. # domain = "www.example.com" @@ -332,7 +331,7 @@ custom_subset = true # data configuration for the webmention.min.js script # The base URL to use for this page. Defaults to window.location -# page_url = "https://beesbuzz.biz/code/439-Falsehoods-programmers-believe-about-email" +# page_url = # Additional URLs to check, separated by |s # add_urls From 2bc1f64acc9c6922e78457bfad3b943d69990276 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 12 Feb 2025 14:08:10 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=93=9D=20docs(blog):=20update=20webme?= =?UTF-8?q?ntions=20configuration=20details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - adjust heading level for webmentions section - simplify webmentions configuration instructions - remove redundant CSP directive explanation 🐛 fix(blog): correct webmentions enabled parameter - change "enable" to "enabled" in config.toml example --- content/blog/mastering-tabi-settings/index.md | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/content/blog/mastering-tabi-settings/index.md b/content/blog/mastering-tabi-settings/index.md index 1fdb47a..f582f77 100644 --- a/content/blog/mastering-tabi-settings/index.md +++ b/content/blog/mastering-tabi-settings/index.md @@ -1,7 +1,7 @@ +++ title = "Mastering tabi Settings: A Comprehensive Guide" date = 2023-09-18 -updated = 2025-02-11 +updated = 2025-02-12 description = "Discover the many ways you can customise your tabi site." [taxonomies] @@ -767,22 +767,15 @@ If you have enabled a system globally, but want to disable it on a specific page Read [the docs](@/blog/comments/index.md) for more information on the available systems and their setup. -## Webmentions +### Webmentions As described by the recommended W3C standard [Webmention][1] is a simple way to notify any URL when you mention it on your site. From the receiver's perspective, it's a way to request notifications when other sites mention it. For static sites [webmention.io][2] hosts a webmention endpoint that can be used to receive webmentions. This feature fetches the webmentions stored at webmention.io and displays them for a page. You will need to have setup an account for your website at webmention.io. When you enable the webmention feature it will advertise your webmention.io endpoint and display the webmentions for any post using the webmention shortcut. -### Configuration and Usage - -Enable webmentions for your site by adding the following to your `config.toml` file. A directive for CSP is required to allow the webmention.io endpoint to be used. - -```toml -[extra] -allowed_domains = [ - { directive = "connect-src", domains = [ "https://webmention.io"] }, -] +Enable webmentions for your site by adding the following to your `config.toml` file. +``` [extra.webmentions] enable = true # Specify the domain registered with webmention.io. From e83cef72ebbd87c6d3965d3d200ee0a567102d66 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 12 Feb 2025 14:08:30 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B=20fix(blog):=20correct=20webme?= =?UTF-8?q?ntion=20config=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix typo in config.toml example from 'enable' to 'enabled' to ensure proper functionality --- content/blog/shortcodes/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/blog/shortcodes/index.md b/content/blog/shortcodes/index.md index 5d115a3..9cbfbac 100644 --- a/content/blog/shortcodes/index.md +++ b/content/blog/shortcodes/index.md @@ -1,7 +1,7 @@ +++ title = "Custom shortcodes" date = 2023-02-19 -updated = 2025-02-11 +updated = 2025-02-12 description = "This theme includes some useful custom shortcodes that you can use to enhance your posts. Whether you want to display images that adapt to light and dark themes, or format a professional-looking reference section, these custom shortcodes have got you covered." [taxonomies] @@ -455,7 +455,7 @@ Enable webmentions for your site, add the following to your `config.toml` file: ```toml [extra.webmentions] -enable = true +enabled = true # Specify the domain registered with webmention.io. domain = "www.example.com" ```