From f5f32aace05ca7de4377c45981703fec8adaa1f3 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:48:33 +0200 Subject: [PATCH] feat(a11y): adopt mod-blocks v2.4.0 so blocks carry heading levels Bumps the example site to mod-blocks v2.4.0, the release that forwards a heading level to section titles. Seven pages that previously rendered no heading at all now open with a real h1: the home page in three languages, the team page in two, and the two documentation landing pages. Adds blocks-demo, the fixture deferred from gethinode/mod-blocks#193. It is the only page carrying both content_blocks and page content, so it is the only cover for single.html's level-2 branch, where blocks render above the page header and their titles become subsections. Co-Authored-By: Claude Opus 5 (1M context) --- exampleSite/content/en/blocks-demo.md | 39 +++++++++++++++++++++++++++ exampleSite/go.mod | 4 +-- exampleSite/go.sum | 4 +++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 exampleSite/content/en/blocks-demo.md diff --git a/exampleSite/content/en/blocks-demo.md b/exampleSite/content/en/blocks-demo.md new file mode 100644 index 00000000..9a6bc551 --- /dev/null +++ b/exampleSite/content/en/blocks-demo.md @@ -0,0 +1,39 @@ +--- +title: Blocks Demo +description: A single page that carries both content blocks and regular page content. +showComments: false +content_blocks: + - _bookshop_name: heading + heading: + title: A block on a page with content + content: >- + Blocks render above the page header, so on a page that also carries + content their titles are subsections and the page title below them + remains the only h1. + - _bookshop_name: cards + heading: + title: What the blocks look like + cols: 2 + elements: + - title: Level from the page + icon: fas layer-group + content: >- + A page template hands its blocks a heading level. A list page renders + no header, so its first titled block opens the page. This page renders + a header, so its blocks start one level down. + - title: Level from the block + icon: fas sliders + content: >- + A block can set `heading_level` itself to pin a level, or `0` to keep + the plain division it rendered before heading levels existed. +--- + +## Regular page content + +Everything above this heading comes from `content_blocks` in the front matter. +Everything from here down is ordinary Markdown, rendered through the page +header and body. + +The page title is the `h1`. The two block titles above are `h2`, and this +heading is an `h2` as well, so the page carries exactly one `h1` and skips no +levels. diff --git a/exampleSite/go.mod b/exampleSite/go.mod index ffffb077..e64f10a5 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -5,11 +5,11 @@ go 1.19 require ( github.com/FortAwesome/Font-Awesome v0.0.0-20260715180930-14c65a3747d0 // indirect github.com/cloudcannon/bookshop/hugo/v3 v3.19.0 // indirect - github.com/gethinode/mod-blocks/v2 v2.3.6 // indirect + github.com/gethinode/mod-blocks/v2 v2.4.0 // indirect github.com/gethinode/mod-bootstrap-icons/v2 v2.0.2 // indirect github.com/gethinode/mod-cookieyes/v3 v3.1.0 // indirect github.com/gethinode/mod-docs v1.15.7 // indirect github.com/gethinode/mod-fontawesome/v6 v6.1.4 // indirect - github.com/gethinode/mod-utils/v6 v6.8.5 // indirect + github.com/gethinode/mod-utils/v6 v6.9.0 // indirect github.com/twbs/icons v1.13.1 // indirect ) diff --git a/exampleSite/go.sum b/exampleSite/go.sum index 4160efbd..4fb6574c 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -4,6 +4,8 @@ github.com/cloudcannon/bookshop/hugo/v3 v3.19.0 h1:khb65FKbLXMWvm34OULEpKReCwNzE github.com/cloudcannon/bookshop/hugo/v3 v3.19.0/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= github.com/gethinode/mod-blocks/v2 v2.3.6 h1:xWvoWBfMXKTjsFuVh3sGZK80uQF1gl6gGt8w4GsZHiE= github.com/gethinode/mod-blocks/v2 v2.3.6/go.mod h1:/IfHiD5PCitH3IrpeMF/Pse/N+AbxkP8AYyIja8oJzk= +github.com/gethinode/mod-blocks/v2 v2.4.0 h1:LjgEpU314lUPMpq63B/rWTUBzWTKTHDk1QSpPpADGJc= +github.com/gethinode/mod-blocks/v2 v2.4.0/go.mod h1:bgbPL/PJzDFyvLcx7bd5uVJkkBDqFd0wZvA4DqqIdXs= github.com/gethinode/mod-bootstrap-icons/v2 v2.0.2 h1:KTQBwRB/1zRO3aS61bH2NNl/uTzelDLFxDjWbrqVKFc= github.com/gethinode/mod-bootstrap-icons/v2 v2.0.2/go.mod h1:oWYYQyAQgOFwrWwBZ8V+ztMCE7XmNTFbcmh28GWO2IA= github.com/gethinode/mod-cookieyes/v3 v3.1.0 h1:wan8yGs1bmwrgdySWSCqDbkiAsbTn8nWogwI+qKH6Is= @@ -14,5 +16,7 @@ github.com/gethinode/mod-fontawesome/v6 v6.1.4 h1:6ppascnfF0Fy9csHLp2iVZVYhaguOO github.com/gethinode/mod-fontawesome/v6 v6.1.4/go.mod h1:VOzKLFEqI4O13IFZrKXOXFFHs26o8PgQtdv9fYUaxqA= github.com/gethinode/mod-utils/v6 v6.8.5 h1:hzJgNjw6NIORMvxeJ3Q6+qPaPzLc4CQtNTWRXFVjFPM= github.com/gethinode/mod-utils/v6 v6.8.5/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= +github.com/gethinode/mod-utils/v6 v6.9.0 h1:+7RsNAfYCaM3rAzwrkTC6Ui3vcpGYWj1Ek1CmUVcaq0= +github.com/gethinode/mod-utils/v6 v6.9.0/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= github.com/twbs/icons v1.13.1 h1:6bmNXvoeIbvjFWjfbjXg5JGbelLD1haIsMaEIzE9UZI= github.com/twbs/icons v1.13.1/go.mod h1:GnRlymgVWp5iVJCMa0Me5b6tFyGpVc2bSxPMRGIJmyA=