Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions exampleSite/content/en/blocks-demo.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions exampleSite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 4 additions & 0 deletions exampleSite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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=