From c45330550f7ef785070393141e10fd9c8bd343fd Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Sun, 12 Jul 2026 15:48:19 +0200 Subject: [PATCH 1/2] feat: seed the exampleSite with a demo page per Bookshop component Extend the placeholder exampleSite so every Bookshop component is rendered (and therefore validated by the argument engine) in CI: one content page per component, demo blog posts and team members for the page-driven components, a releases data file, a demo contact-form hook, and a Hinode import that provides the shared partials the components call at site build time. Co-Authored-By: Claude Fable 5 --- exampleSite/assets/img/placeholder.png | Bin 0 -> 3388 bytes exampleSite/content/_index.md | 27 +++- exampleSite/content/blog/_index.md | 4 + exampleSite/content/blog/post-1.md | 10 ++ exampleSite/content/blog/post-2.md | 10 ++ exampleSite/content/blog/post-3.md | 10 ++ exampleSite/content/components/_index.md | 4 + exampleSite/content/components/about.md | 25 ++++ exampleSite/content/components/approach.md | 24 +++ exampleSite/content/components/articles.md | 22 +++ exampleSite/content/components/cards.md | 27 ++++ .../content/components/contact-form.md | 17 +++ exampleSite/content/components/cta.md | 21 +++ exampleSite/content/components/faq.md | 17 +++ exampleSite/content/components/featured.md | 18 +++ exampleSite/content/components/heading.md | 11 ++ exampleSite/content/components/hero.md | 24 +++ exampleSite/content/components/list.md | 17 +++ exampleSite/content/components/menu.md | 13 ++ exampleSite/content/components/panels.md | 18 +++ exampleSite/content/components/preview.md | 17 +++ exampleSite/content/components/releases.md | 11 ++ exampleSite/content/components/separator.md | 14 ++ exampleSite/content/components/team.md | 18 +++ .../content/components/testimonials.md | 23 +++ .../content/components/video-message.md | 23 +++ exampleSite/content/team/_index.md | 4 + exampleSite/content/team/jane-doe.md | 7 + exampleSite/content/team/john-smith.md | 7 + exampleSite/data/releases.yml | 16 ++ exampleSite/go.mod | 4 +- exampleSite/go.sum | 140 +----------------- exampleSite/hugo.toml | 49 +++++- exampleSite/layouts/_default/baseof.html | 14 -- exampleSite/layouts/_default/home.html | 16 -- exampleSite/layouts/_default/list.html | 7 - exampleSite/layouts/_default/single.html | 4 - .../layouts/_partials/blocks/demo-form.html | 21 +++ exampleSite/mod-blocks.work.sum | 28 ++++ exampleSite/static/style.css | 0 40 files changed, 554 insertions(+), 188 deletions(-) create mode 100644 exampleSite/assets/img/placeholder.png create mode 100644 exampleSite/content/blog/_index.md create mode 100644 exampleSite/content/blog/post-1.md create mode 100644 exampleSite/content/blog/post-2.md create mode 100644 exampleSite/content/blog/post-3.md create mode 100644 exampleSite/content/components/_index.md create mode 100644 exampleSite/content/components/about.md create mode 100644 exampleSite/content/components/approach.md create mode 100644 exampleSite/content/components/articles.md create mode 100644 exampleSite/content/components/cards.md create mode 100644 exampleSite/content/components/contact-form.md create mode 100644 exampleSite/content/components/cta.md create mode 100644 exampleSite/content/components/faq.md create mode 100644 exampleSite/content/components/featured.md create mode 100644 exampleSite/content/components/heading.md create mode 100644 exampleSite/content/components/hero.md create mode 100644 exampleSite/content/components/list.md create mode 100644 exampleSite/content/components/menu.md create mode 100644 exampleSite/content/components/panels.md create mode 100644 exampleSite/content/components/preview.md create mode 100644 exampleSite/content/components/releases.md create mode 100644 exampleSite/content/components/separator.md create mode 100644 exampleSite/content/components/team.md create mode 100644 exampleSite/content/components/testimonials.md create mode 100644 exampleSite/content/components/video-message.md create mode 100644 exampleSite/content/team/_index.md create mode 100644 exampleSite/content/team/jane-doe.md create mode 100644 exampleSite/content/team/john-smith.md create mode 100644 exampleSite/data/releases.yml delete mode 100644 exampleSite/layouts/_default/baseof.html delete mode 100644 exampleSite/layouts/_default/home.html delete mode 100644 exampleSite/layouts/_default/list.html delete mode 100644 exampleSite/layouts/_default/single.html create mode 100644 exampleSite/layouts/_partials/blocks/demo-form.html create mode 100644 exampleSite/mod-blocks.work.sum delete mode 100644 exampleSite/static/style.css diff --git a/exampleSite/assets/img/placeholder.png b/exampleSite/assets/img/placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..991d243edc428654fa4bfaa11538afdd71a92685 GIT binary patch literal 3388 zcmeAS@N?(olHy`uVBq!ia0y~yVA;UHz_gfy2`JKZF>yLjoY~XGF{I+w+v|qB3<^99 z2VbocS)$mtkl9MBxh1ZMtM2!St&9u|5*jK%Ee0(>Lc$41@F)U_HUS{v%)!9Wpvc0& za6kZPY61sPG1ZjO(JHXRc@~0#iss%z3nW^GAevR6Xlqam0mcyxVhf91h_J*fNrUu5 zwKPbI!|9VN5H6y3N`)jJvh(^Li9^BSzy#Pxp*ds~3-nL$s=%^@-pP=xprN1)A1yIy zR$m~pIej9P-boegztIwt`epcNNk`>oC?uthwha-jIqEjp2Dqe)&)zXNz|gBM%MMs! OGkCiCxvX- + This test site renders every Bookshop component provided by mod-blocks, + so the argument validation engine exercises each component blueprint in CI. + align: start + width: 6 + illustration: + icon: fas cubes + links: + - title: Browse components + url: /components/ + icon: fas chevron-right + orientation: horizontal + background: + color: primary + subtle: true --- - -TODO: placeholder \ No newline at end of file diff --git a/exampleSite/content/blog/_index.md b/exampleSite/content/blog/_index.md new file mode 100644 index 0000000..7c8fe8d --- /dev/null +++ b/exampleSite/content/blog/_index.md @@ -0,0 +1,4 @@ +--- +title: Blog +description: Demo posts used by the articles and list components. +--- diff --git a/exampleSite/content/blog/post-1.md b/exampleSite/content/blog/post-1.md new file mode 100644 index 0000000..02612d3 --- /dev/null +++ b/exampleSite/content/blog/post-1.md @@ -0,0 +1,10 @@ +--- +title: Demo post 1 +description: Demo blog post 1 used as input for the articles and list components. +date: 2026-07-01 +tags: + - demo +--- + +This is demo blog post 1. It exists so the articles and list components have +pages to render. diff --git a/exampleSite/content/blog/post-2.md b/exampleSite/content/blog/post-2.md new file mode 100644 index 0000000..e134873 --- /dev/null +++ b/exampleSite/content/blog/post-2.md @@ -0,0 +1,10 @@ +--- +title: Demo post 2 +description: Demo blog post 2 used as input for the articles and list components. +date: 2026-07-02 +tags: + - demo +--- + +This is demo blog post 2. It exists so the articles and list components have +pages to render. diff --git a/exampleSite/content/blog/post-3.md b/exampleSite/content/blog/post-3.md new file mode 100644 index 0000000..092ba1c --- /dev/null +++ b/exampleSite/content/blog/post-3.md @@ -0,0 +1,10 @@ +--- +title: Demo post 3 +description: Demo blog post 3 used as input for the articles and list components. +date: 2026-07-03 +tags: + - demo +--- + +This is demo blog post 3. It exists so the articles and list components have +pages to render. diff --git a/exampleSite/content/components/_index.md b/exampleSite/content/components/_index.md new file mode 100644 index 0000000..076be6d --- /dev/null +++ b/exampleSite/content/components/_index.md @@ -0,0 +1,4 @@ +--- +title: Components +description: One demo page per Bookshop component provided by mod-blocks. +--- diff --git a/exampleSite/content/components/about.md b/exampleSite/content/components/about.md new file mode 100644 index 0000000..7a52622 --- /dev/null +++ b/exampleSite/content/components/about.md @@ -0,0 +1,25 @@ +--- +title: About +description: Demo of the about component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: about + heading: + preheading: What we are + title: About this component + content: >- + The about component combines a heading, an illustration, and action + links in a two-column layout. + align: start + width: 8 + illustration: + image: /img/placeholder.png + links: + - title: Get in touch + url: /components/contact-form/ + icon: fas chevron-right + order: first + background: + color: primary + subtle: true +--- diff --git a/exampleSite/content/components/approach.md b/exampleSite/content/components/approach.md new file mode 100644 index 0000000..f3a6620 --- /dev/null +++ b/exampleSite/content/components/approach.md @@ -0,0 +1,24 @@ +--- +title: Approach +description: Demo of the approach component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: approach + heading: + preheading: How we work + title: Our approach + content: The approach component inserts a featured illustration between the title and the cards. + illustration: + icon: fas diagram-project + cols: 3 + elements: + - title: Discover + icon: fas magnifying-glass + content: Understand the problem space before writing any code. + - title: Design + icon: fas pen-ruler + content: Sketch the component structure and its arguments. + - title: Deliver + icon: fas truck-fast + content: Ship the component with tests and documentation. +--- diff --git a/exampleSite/content/components/articles.md b/exampleSite/content/components/articles.md new file mode 100644 index 0000000..56ea23a --- /dev/null +++ b/exampleSite/content/components/articles.md @@ -0,0 +1,22 @@ +--- +title: Articles +description: Demo of the articles component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: articles + heading: + preheading: Blog + title: Recent posts + align: start + hide_empty: false + header_style: none + input: + section: blog + reverse: true + sort: date + more: + title: More blog posts + cols: 3 + padding: 0 + limit: 3 +--- diff --git a/exampleSite/content/components/cards.md b/exampleSite/content/components/cards.md new file mode 100644 index 0000000..e66d079 --- /dev/null +++ b/exampleSite/content/components/cards.md @@ -0,0 +1,27 @@ +--- +title: Cards +description: Demo of the cards component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: cards + heading: + preheading: Our values + title: A card group + content: The cards component renders a group of icon cards. + cols: 3 + padding: 0 + elements: + - title: People oriented + icon: fas user-group + content: People are at the heart of any organization. + - title: Value obsessed + icon: fas heart + content: We ensure your investments bring tangible value. + - title: Tech savvy + icon: fas microchip + content: We help you identify and utilize the right technology. + links: + - title: All components + url: /components/ + icon: fas chevron-right +--- diff --git a/exampleSite/content/components/contact-form.md b/exampleSite/content/components/contact-form.md new file mode 100644 index 0000000..6dd1d00 --- /dev/null +++ b/exampleSite/content/components/contact-form.md @@ -0,0 +1,17 @@ +--- +title: Contact form +description: Demo of the contact-form component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: contact-form + heading: + preheading: Contact + title: Get in touch + content: The contact-form component renders a site-provided form hook. + align: start + hook: blocks/demo-form + action: '#!' + form_id: demo-form + illustration: + icon: fas envelope-open-text +--- diff --git a/exampleSite/content/components/cta.md b/exampleSite/content/components/cta.md new file mode 100644 index 0000000..3989337 --- /dev/null +++ b/exampleSite/content/components/cta.md @@ -0,0 +1,21 @@ +--- +title: Call to action +description: Demo of the cta component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: cta + heading: + preheading: Ready to start? + title: A call to action + content: The cta component highlights a next step with action links. + align: start + illustration: + icon: fas bullhorn + links: + - title: Browse components + url: /components/ + icon: fas chevron-right + background: + color: secondary + subtle: true +--- diff --git a/exampleSite/content/components/faq.md b/exampleSite/content/components/faq.md new file mode 100644 index 0000000..e29b687 --- /dev/null +++ b/exampleSite/content/components/faq.md @@ -0,0 +1,17 @@ +--- +title: FAQ +description: Demo of the faq component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: faq + heading: + preheading: Support + title: Frequently asked questions + items: + - title: What is mod-blocks? + description: A Hugo module that adds Bookshop blocks to your Hinode site. + - title: Do I need CloudCannon? + description: No, the components render in any Hugo build; CloudCannon adds live editing. + - title: How are arguments validated? + description: Every component validates its blueprint through the mod-utils argument engine. +--- diff --git a/exampleSite/content/components/featured.md b/exampleSite/content/components/featured.md new file mode 100644 index 0000000..416ccb5 --- /dev/null +++ b/exampleSite/content/components/featured.md @@ -0,0 +1,18 @@ +--- +title: Featured +description: Demo of the featured component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: featured + heading: + preheading: Spotlight + title: A featured section + content: The featured component pairs a heading with an illustration and links. + align: start + illustration: + image: /img/placeholder.png + links: + - title: Learn more + url: /components/ + icon: fas chevron-right +--- diff --git a/exampleSite/content/components/heading.md b/exampleSite/content/components/heading.md new file mode 100644 index 0000000..e1a48de --- /dev/null +++ b/exampleSite/content/components/heading.md @@ -0,0 +1,11 @@ +--- +title: Heading +description: Demo of the heading component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: heading + heading: + preheading: Typography + title: A standalone heading + content: The heading component renders a section title without further content. +--- diff --git a/exampleSite/content/components/hero.md b/exampleSite/content/components/hero.md new file mode 100644 index 0000000..b4806f0 --- /dev/null +++ b/exampleSite/content/components/hero.md @@ -0,0 +1,24 @@ +--- +title: Hero +description: Demo of the hero component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: hero + breadcrumb: true + heading: + preheading: Component demo + title: A **hero** banner + content: The hero supports a heading, featured illustration, and navigation links. + align: start + width: 6 + illustration: + icon: fas rocket + links: + - title: Get started + url: /components/ + icon: fas chevron-right + orientation: horizontal + background: + color: primary + subtle: true +--- diff --git a/exampleSite/content/components/list.md b/exampleSite/content/components/list.md new file mode 100644 index 0000000..c8eb71c --- /dev/null +++ b/exampleSite/content/components/list.md @@ -0,0 +1,17 @@ +--- +title: List +description: Demo of the list component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: list + heading: + preheading: Blog + title: A page list + align: start + hide_empty: false + input: + section: blog + reverse: true + sort: date + limit: 3 +--- diff --git a/exampleSite/content/components/menu.md b/exampleSite/content/components/menu.md new file mode 100644 index 0000000..a3a546b --- /dev/null +++ b/exampleSite/content/components/menu.md @@ -0,0 +1,13 @@ +--- +title: Menu +description: Demo of the menu component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: menu + heading: + preheading: Navigation + title: A menu section + menu: main + menu_style: grid + cols: 2 +--- diff --git a/exampleSite/content/components/panels.md b/exampleSite/content/components/panels.md new file mode 100644 index 0000000..7d7e5be --- /dev/null +++ b/exampleSite/content/components/panels.md @@ -0,0 +1,18 @@ +--- +title: Panels +description: Demo of the panels component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: panels + heading: + preheading: Tabs + title: A panel group + content: The panels component renders elements as tabbed panes. + elements: + - title: First panel + icon: fas star + content: Content of the first panel. + - title: Second panel + icon: fas bolt + content: Content of the second panel. +--- diff --git a/exampleSite/content/components/preview.md b/exampleSite/content/components/preview.md new file mode 100644 index 0000000..0b08eb2 --- /dev/null +++ b/exampleSite/content/components/preview.md @@ -0,0 +1,17 @@ +--- +title: Preview +description: Demo of the preview component. +date: 2026-07-12 +modules: + - preview +content_blocks: + - _bookshop_name: preview + heading: + preheading: Live preview + title: A device preview + content: The preview component renders a URL in switchable device frames. + url: https://gethinode.com + device: desktop + show_fallback: true + image: /img/placeholder.png +--- diff --git a/exampleSite/content/components/releases.md b/exampleSite/content/components/releases.md new file mode 100644 index 0000000..5141648 --- /dev/null +++ b/exampleSite/content/components/releases.md @@ -0,0 +1,11 @@ +--- +title: Releases +description: Demo of the releases component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: releases + heading: + preheading: Changelog + title: Release timeline + data: releases +--- diff --git a/exampleSite/content/components/separator.md b/exampleSite/content/components/separator.md new file mode 100644 index 0000000..3555f85 --- /dev/null +++ b/exampleSite/content/components/separator.md @@ -0,0 +1,14 @@ +--- +title: Separator +description: Demo of the separator component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: heading + heading: + title: Above the separator + - _bookshop_name: separator + clear: false + - _bookshop_name: heading + heading: + title: Below the separator +--- diff --git a/exampleSite/content/components/team.md b/exampleSite/content/components/team.md new file mode 100644 index 0000000..e79b116 --- /dev/null +++ b/exampleSite/content/components/team.md @@ -0,0 +1,18 @@ +--- +title: Team +description: Demo of the team component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: team + heading: + preheading: People + title: Meet the team + align: start + hide_empty: false + input: + section: team + sort: title + cols: 2 + padding: 0 + limit: 2 +--- diff --git a/exampleSite/content/components/testimonials.md b/exampleSite/content/components/testimonials.md new file mode 100644 index 0000000..864d81b --- /dev/null +++ b/exampleSite/content/components/testimonials.md @@ -0,0 +1,23 @@ +--- +title: Testimonials +description: Demo of the testimonials component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: testimonials + heading: + preheading: Clients + title: What our clients say + cols: 2 + responsive: false + testimonials: + - icon: fas quote-left + content: Hinode is an excellent theme for building documentation sites. + client: + contact: Jane Doe + url: https://example.com + - icon: fas quote-left + content: Highly recommended for documentation and blog sites alike. + client: + contact: John Smith + url: https://example.org +--- diff --git a/exampleSite/content/components/video-message.md b/exampleSite/content/components/video-message.md new file mode 100644 index 0000000..5b1ea38 --- /dev/null +++ b/exampleSite/content/components/video-message.md @@ -0,0 +1,23 @@ +--- +title: Video message +description: Demo of the video-message component. +date: 2026-07-12 +content_blocks: + - _bookshop_name: video-message + heading: + preheading: Watch + title: A video with messages + content: The video-message component pairs an embedded video with message cards. + video: + provider: youtube + media_id: dQw4w9WgXcQ + orientation: stacked + cols: 2 + messages: + - title: Fast onboarding + icon: fas gauge-high + content: Get productive with the component library in minutes. + - title: Fully validated + icon: fas shield + content: Every argument is validated against the component blueprint. +--- diff --git a/exampleSite/content/team/_index.md b/exampleSite/content/team/_index.md new file mode 100644 index 0000000..afbf68d --- /dev/null +++ b/exampleSite/content/team/_index.md @@ -0,0 +1,4 @@ +--- +title: Team +description: Demo team members used by the team component. +--- diff --git a/exampleSite/content/team/jane-doe.md b/exampleSite/content/team/jane-doe.md new file mode 100644 index 0000000..c104907 --- /dev/null +++ b/exampleSite/content/team/jane-doe.md @@ -0,0 +1,7 @@ +--- +title: Jane Doe +description: Principal engineer and maintainer of the component library. +date: 2026-01-10 +--- + +Jane maintains the component library. diff --git a/exampleSite/content/team/john-smith.md b/exampleSite/content/team/john-smith.md new file mode 100644 index 0000000..de23a42 --- /dev/null +++ b/exampleSite/content/team/john-smith.md @@ -0,0 +1,7 @@ +--- +title: John Smith +description: Designer focusing on accessible, responsive layouts. +date: 2026-01-11 +--- + +John designs the component layouts. diff --git a/exampleSite/data/releases.yml b/exampleSite/data/releases.yml new file mode 100644 index 0000000..dcfe4e2 --- /dev/null +++ b/exampleSite/data/releases.yml @@ -0,0 +1,16 @@ +- title: v2.0.0 + date: 2026-07-12 + content: Adopts the mod-utils v6 validation engine. + color: primary + icon: fas rocket + badge: latest +- title: v1.23.0 + date: 2026-06-01 + content: Adds mobile-aware section and hero padding. + color: secondary + icon: fas mobile-screen +- title: v1.0.0 + date: 2025-01-15 + content: First stable release of the Bookshop component library. + color: success + icon: fas flag-checkered diff --git a/exampleSite/go.mod b/exampleSite/go.mod index a564dc7..aab4a41 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -3,7 +3,5 @@ module github.com/gethinode/mod-blocks/exampleSite go 1.19 require ( - github.com/cloudcannon/bookshop/hugo/v3 v3.18.5 // indirect - github.com/gethinode/mod-blocks v1.23.6 // indirect - github.com/gethinode/mod-utils/v5 v5.23.4 // indirect + github.com/gethinode/hinode/v2 v2.20.0 // indirect ) diff --git a/exampleSite/go.sum b/exampleSite/go.sum index e862cfe..fb9f356 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -1,138 +1,2 @@ -github.com/cloudcannon/bookshop/hugo/v3 v3.17.1 h1:weTVWBamjQHMIp/oYTFsPwRzzhWrZA6JO43QnxI1kxw= -github.com/cloudcannon/bookshop/hugo/v3 v3.17.1/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.0 h1:Hy4UrNwvXBC1TiTmsGnYp8T1VLbdK/NBNvj7HphLBpI= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.0/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.2 h1:j3XUvvuCv/7SfGKzd7gzb3WEgs1DurqTRDe7gdMAAvU= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.2/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.3 h1:HMhrR7gkQt/cvOfSl64TgaBsD3mLLD/dAFVLLaj2boQ= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.3/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.4 h1:mZCALkYdpXKUrw7O1WtLcL5FSFt7nt5HXvs+TczRHf0= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.4/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.5 h1:AKWzUQpWcBSbJgHQ/5cfPQtGX40bn8vbHBGk4rlHEGE= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.5/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/gethinode/mod-blocks v1.0.5 h1:IYWyz04kfCst8NXADivjvwRho3EOJRji74/kR+M4mAY= -github.com/gethinode/mod-blocks v1.0.5/go.mod h1:H3Slh4BaxmYLX61YXyO/yqMZHlCwSlvX3VekDpnWCSM= -github.com/gethinode/mod-blocks v1.0.6 h1:9lKJpChCwqYP6Hz1971TPnVrZiydz4nXoGlIzOlsIkw= -github.com/gethinode/mod-blocks v1.0.6/go.mod h1:H3Slh4BaxmYLX61YXyO/yqMZHlCwSlvX3VekDpnWCSM= -github.com/gethinode/mod-blocks v1.2.0 h1:+UN9DjpmH53jU6T4+yjC0xShTg8FA/MRZ2XNNKxcjgw= -github.com/gethinode/mod-blocks v1.2.0/go.mod h1:H3Slh4BaxmYLX61YXyO/yqMZHlCwSlvX3VekDpnWCSM= -github.com/gethinode/mod-blocks v1.3.0 h1:Aj0kIIOFDHU83F4r7zfO54YatHr56KxWosPomANbyMM= -github.com/gethinode/mod-blocks v1.3.0/go.mod h1:H3Slh4BaxmYLX61YXyO/yqMZHlCwSlvX3VekDpnWCSM= -github.com/gethinode/mod-blocks v1.3.1 h1:LuwUVSgBrXQ6jBIoNPt730HA8TMJQVNIDxwKIgWTimo= -github.com/gethinode/mod-blocks v1.3.1/go.mod h1:H3Slh4BaxmYLX61YXyO/yqMZHlCwSlvX3VekDpnWCSM= -github.com/gethinode/mod-blocks v1.3.2 h1:k41aZFj8ca1/3Luuy1/pAcXLQZ8g36vumXMMsV9LeIQ= -github.com/gethinode/mod-blocks v1.3.2/go.mod h1:tWJHYxqGv4soXHH/DOHEpxtvv/rjp5GQdv7TAgxODnA= -github.com/gethinode/mod-blocks v1.4.0 h1:WGxpyNUEWGxpT2zFkPEFkl/irkaegFUB4hcaLjfQhC4= -github.com/gethinode/mod-blocks v1.4.0/go.mod h1:R3NMyLEbu54wiFThuuo9y5JfsZUS5Gn9wZJPxq0T8BM= -github.com/gethinode/mod-blocks v1.4.1 h1:zaO6VcrQGeF8hyXPFYB5UfX1fW3LUxyL7U7KavwAmeA= -github.com/gethinode/mod-blocks v1.4.1/go.mod h1:R3NMyLEbu54wiFThuuo9y5JfsZUS5Gn9wZJPxq0T8BM= -github.com/gethinode/mod-blocks v1.5.2 h1:mfzXlYmfc7MBULR2Pn7+3r92K8hIe2RNRm0eufz/JoM= -github.com/gethinode/mod-blocks v1.5.2/go.mod h1:R3NMyLEbu54wiFThuuo9y5JfsZUS5Gn9wZJPxq0T8BM= -github.com/gethinode/mod-blocks v1.5.3 h1:KBELyr4CYvxzSKlJDGgf9jbsfSZh2++UOQqNmDLrKzA= -github.com/gethinode/mod-blocks v1.5.3/go.mod h1:R3NMyLEbu54wiFThuuo9y5JfsZUS5Gn9wZJPxq0T8BM= -github.com/gethinode/mod-blocks v1.6.0 h1:zaSKAADCZCX4+bTHHxr/AeoWvSYp+WWFaR8bLOSSnzE= -github.com/gethinode/mod-blocks v1.6.0/go.mod h1:kktP6gmIsyZxOcYXmZ25Wu5n51yIRQ0GijXUjx9bWaU= -github.com/gethinode/mod-blocks v1.7.0 h1:qEuETmIV1OFusRAWR50Q/UoqrZhR500ijSntNaU63QA= -github.com/gethinode/mod-blocks v1.7.0/go.mod h1:R6npt7cWC5vUP3LsHZNjryFYdhtXEOpfVLTWmcJqmDQ= -github.com/gethinode/mod-blocks v1.9.0 h1:KJwmaRKS7uLoZTskvMCsVSxa9yR/eNcS0X9fzTn51ak= -github.com/gethinode/mod-blocks v1.9.0/go.mod h1:kxmtogbVK/BlYiy8INFq5EaVGAWdJoVmJYDgkAPp3qU= -github.com/gethinode/mod-blocks v1.10.0 h1:kYh+DIY3mFaZFL96JQXl81mq23CZzv0eIcNrxQAFino= -github.com/gethinode/mod-blocks v1.10.0/go.mod h1:33+IprRvmcxkLPCJKqMrvMHIw3S/Rv4lK4sWUqWr1fA= -github.com/gethinode/mod-blocks v1.11.0 h1:R6U3qJAUGFbwEHmhuycS++BfSgAJtn5n6HDhKG5FuCc= -github.com/gethinode/mod-blocks v1.11.0/go.mod h1:33+IprRvmcxkLPCJKqMrvMHIw3S/Rv4lK4sWUqWr1fA= -github.com/gethinode/mod-blocks v1.12.0 h1:yYUmLJR3pYDnsbTXR/yvQdTAba/gjtp6AK9nA/pHiv4= -github.com/gethinode/mod-blocks v1.12.0/go.mod h1:33+IprRvmcxkLPCJKqMrvMHIw3S/Rv4lK4sWUqWr1fA= -github.com/gethinode/mod-blocks v1.12.1 h1:6F9jOBQgBHadd9OtRiQzsA5R0WdP9xOHZRWudswk/kM= -github.com/gethinode/mod-blocks v1.12.1/go.mod h1:cAqHtgb/jApkNmwgxtUj2X7Zoh9mHa5P8wM5STQks24= -github.com/gethinode/mod-blocks v1.12.2 h1:sGRqahSgkSdqCdcwmiSbeN6pBw0mwUuZDjdEJqFaoNQ= -github.com/gethinode/mod-blocks v1.12.2/go.mod h1:msM51EuP/fvuprF/gbcyeFqczkpem7LRsAGa1F9r8IY= -github.com/gethinode/mod-blocks v1.12.3 h1:eiVIXZ61MkdycDWPJsjpeU9lwtKO/6yAFX8TQz9ZXd0= -github.com/gethinode/mod-blocks v1.12.3/go.mod h1:zuYPZrFa68/evskOUpreOlpdpH5Rg4UKEf54gi6wMls= -github.com/gethinode/mod-blocks v1.13.0 h1:/EgthXfhKFvDwsP9tFVUjNFR1h37wCoPQu8A/XRx4oo= -github.com/gethinode/mod-blocks v1.13.0/go.mod h1:jJ9VcUecK16bXza0uGVdOpKeuV+d+qVtjfLKvR4jFA8= -github.com/gethinode/mod-blocks v1.13.1 h1:kCHOEAGXzy0M/tPdKMW3wIbLWq1qhx99K1eVmkNIIag= -github.com/gethinode/mod-blocks v1.13.1/go.mod h1:jJ9VcUecK16bXza0uGVdOpKeuV+d+qVtjfLKvR4jFA8= -github.com/gethinode/mod-blocks v1.13.2 h1:M8181RS6FloyJcayVxqxzMDwuv1+IwpiGbT5u8eWrDo= -github.com/gethinode/mod-blocks v1.13.2/go.mod h1:jJ9VcUecK16bXza0uGVdOpKeuV+d+qVtjfLKvR4jFA8= -github.com/gethinode/mod-blocks v1.14.0 h1:OYJymixs7EtE4eeOTFco2pAckWpers2Vk9mVQkhELwQ= -github.com/gethinode/mod-blocks v1.14.0/go.mod h1:xcYuTxTh0DJz2zQqERgG5Tjzj7Sr+luQjvqfc04K3tI= -github.com/gethinode/mod-blocks v1.15.0 h1:FUQRPvoqqMKbkJORwvlLwEPed28iwglo8VqUN89danw= -github.com/gethinode/mod-blocks v1.15.0/go.mod h1:xcYuTxTh0DJz2zQqERgG5Tjzj7Sr+luQjvqfc04K3tI= -github.com/gethinode/mod-blocks v1.15.1 h1:gKUclJD+yUhsrLRr5uheOJ2MMLK2EuAAZFZI6nCpc68= -github.com/gethinode/mod-blocks v1.15.1/go.mod h1:A9WagW9TCZxv/VsVF92CATjfxeVDKBrhF1n33IV9250= -github.com/gethinode/mod-blocks v1.15.2 h1:Sx1HdveBvJuQlTw1rfKwW4nkVZfJuien+6CykLGvo90= -github.com/gethinode/mod-blocks v1.15.2/go.mod h1:iG/4tXktwqgUyzHyRbuAHmGsdQwmEhUG/YkufNcUe+k= -github.com/gethinode/mod-blocks v1.15.3 h1:GORSj6ehAGuOTBKvXSGiy8EuCx5hnbEJvgVoW4gIDEg= -github.com/gethinode/mod-blocks v1.15.3/go.mod h1:jX1qXECc+RNBiGE9lOhc+5QE7JvCBWL1m/dzY2F6Dx4= -github.com/gethinode/mod-blocks v1.16.1 h1:jO1lnFJqgDDqQQs0n8gnsu1o1n9MIde9LDuAFcnnjA4= -github.com/gethinode/mod-blocks v1.16.1/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.16.2 h1:q6jHbpLUUvAPc5u2DV3b5aEiFHQZYum0yqkKepMusuM= -github.com/gethinode/mod-blocks v1.16.2/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.17.0 h1:9CU/DpBz1jwBfSOcuwXlT4BxHTNBDb9JN9LR1RHTzc0= -github.com/gethinode/mod-blocks v1.17.0/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.18.0 h1:zOlvsHo0td407WztbaRJRHYHvuc53FJcQcYvfiZNdU0= -github.com/gethinode/mod-blocks v1.18.0/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.18.1 h1:FjMDAqgiNyZcRQYkHeQjzN7tyDEwxNrq4SCyHKxVYMs= -github.com/gethinode/mod-blocks v1.18.1/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.19.1 h1:rBr+GRFJCvm9k7tm+q26X6r3uX25wTeH7X4U9y0qtJg= -github.com/gethinode/mod-blocks v1.19.1/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.19.2 h1:Yw1eKx+kepdObzgtd/7xZGvwuatVrZmzO8B3G3M8/4E= -github.com/gethinode/mod-blocks v1.19.2/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.20.0 h1:9tBxHZQYx2rnW4OB4Gj7VszJhafycJMSZsWKc86FI1c= -github.com/gethinode/mod-blocks v1.20.0/go.mod h1:sAMe4iLdX14DQQ8cl0GN6k1TTjZzpRnKQ9OafgN9rAw= -github.com/gethinode/mod-blocks v1.21.0 h1:PJnFiLAQysREjyDdc8LRIvcWgbdrLDWh/33E23H7n0k= -github.com/gethinode/mod-blocks v1.21.0/go.mod h1:J5pThiZWwFsaYypOs+PXGJKWJ9DZ/USqRETM1bIxfXk= -github.com/gethinode/mod-blocks v1.22.0 h1:/1Hpr4Ogeq9tesNKzeCPatol6bKZt/X5ULKDgBTk100= -github.com/gethinode/mod-blocks v1.22.0/go.mod h1:7a0rJUYtWi9HJZ6sf/7aiuZiVnMxh/r8ZuArv0ELlbM= -github.com/gethinode/mod-blocks v1.22.1 h1:akTuUmBbC81SvgfVIRXCu/g4UuelEYnlhjYNVmyE2UM= -github.com/gethinode/mod-blocks v1.22.1/go.mod h1:7a0rJUYtWi9HJZ6sf/7aiuZiVnMxh/r8ZuArv0ELlbM= -github.com/gethinode/mod-blocks v1.23.0 h1:0JQxxMfVjhO7Wj10rrTCkMWIMOFsFScqZh4dsPXlixY= -github.com/gethinode/mod-blocks v1.23.0/go.mod h1:JbyOXhbdGPKaIvzu44XKWgivoFSpdG8xB7tXrFfFIrw= -github.com/gethinode/mod-blocks v1.23.1 h1:pgFL5eepVqgHdsSQ8AcDTw4w35FcvwWP3iQCrHIhZNc= -github.com/gethinode/mod-blocks v1.23.1/go.mod h1:JbyOXhbdGPKaIvzu44XKWgivoFSpdG8xB7tXrFfFIrw= -github.com/gethinode/mod-blocks v1.23.4 h1:6JGzFnKIf9muMTSKN0UGc99D0SahAk9VZCMEN4G9iFs= -github.com/gethinode/mod-blocks v1.23.4/go.mod h1:ye9nqj3ZwBFogULac71EzH7bP0nPm0pFBGm7++YxCbA= -github.com/gethinode/mod-blocks v1.23.6 h1:Kg0RAlMhz2j1W60sERvHQyAa8H6UbNfMl9ZJajh/vKU= -github.com/gethinode/mod-blocks v1.23.6/go.mod h1:zSbs/OyzCDt4Kvn/9e1Zi8K1tweJANfibHUr/jcOrt4= -github.com/gethinode/mod-utils/v5 v5.10.0 h1:NlofAfa1YILV9pwS8vMkEwVUdrnKCoIlVwJPm3+UVGs= -github.com/gethinode/mod-utils/v5 v5.10.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.11.0 h1:1BO9uK0zecHF6dNJcqX8NFNHSIdizlyj88n9ylLUsDc= -github.com/gethinode/mod-utils/v5 v5.11.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.11.1 h1:LfVXEh3dYwIFNyL4i3R9YinfN1yf1PQTivKQ2sUsCQY= -github.com/gethinode/mod-utils/v5 v5.11.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.12.0 h1:XH6/MsvgPfYVD8Ci3t20vRH3Zz1JpaqqG6X0/j3mRSE= -github.com/gethinode/mod-utils/v5 v5.12.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.13.0 h1:ztkE1REey94x36UdlZ7yeitpIQid/BcZQh+wtxBTSQ8= -github.com/gethinode/mod-utils/v5 v5.13.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.14.0 h1:Nntb2ei7yTRsUmGMUHo/fgCfacIk+GD/ZbSW64gu6HM= -github.com/gethinode/mod-utils/v5 v5.14.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.15.0 h1:8X/QT/O/OQaN6IISVg9C4/mp/DIr2+q+ofM7Ll3pLT8= -github.com/gethinode/mod-utils/v5 v5.15.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.15.1 h1:DE3zpIdHznpI7xOB8u+++MQHr4mdGE/WdAa7/M0lKC4= -github.com/gethinode/mod-utils/v5 v5.15.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.16.0 h1:RqZZKJ3cyjwCyjrzH93FBnI7zQgr+RZaSRQUAq3D3uI= -github.com/gethinode/mod-utils/v5 v5.16.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.16.1 h1:WzE+xFKmOGX5zAhJ/udR0BFMEiGSbFVLBX/s/n58Rmo= -github.com/gethinode/mod-utils/v5 v5.16.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.17.0 h1:qwOGyfWWmaSTQBaYrhRNYN/ATuTZ7XXOeAjLETxMGR0= -github.com/gethinode/mod-utils/v5 v5.17.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.18.0 h1:qRdwc7f+heVPJJh+383QgAYFc9i2jKHAr35ozawM9fI= -github.com/gethinode/mod-utils/v5 v5.18.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.19.0 h1:fX3gTsYoimUNqD/KeBsyBrrJ2DygQ0M7Rc8gL1HT5Tc= -github.com/gethinode/mod-utils/v5 v5.19.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.19.1 h1:peyYRxjIf8d84mt435veKaiO5nrIBXQ5xrHKHqcJehw= -github.com/gethinode/mod-utils/v5 v5.19.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.20.0 h1:K+oBv8kJ4pVj4m1HlxgJiC+DYNX4oumqS6Cvcp2C8Ho= -github.com/gethinode/mod-utils/v5 v5.20.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.22.0 h1:zVTzU4BQjqWcA4wrpvjrgxyLOHO+jxdLKiIiYMwbMV8= -github.com/gethinode/mod-utils/v5 v5.22.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.0 h1:PW4ceewrDiO7k3zVjtiLeyrKnAR4UEAxaXH6ja8CNSs= -github.com/gethinode/mod-utils/v5 v5.23.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.1 h1:Y6c+039rk8vA2m4t739osgDrXbQe3SHX9mF7K0mZSmI= -github.com/gethinode/mod-utils/v5 v5.23.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.2 h1:d89TkxTYeOVFdOpCtESmnXE7hQs53zxCwAIes4yNu1E= -github.com/gethinode/mod-utils/v5 v5.23.2/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.3 h1:ifcDyTYpmM6HBzc6SbpG+hJMSCfGTZKf/plgjVW2qZ4= -github.com/gethinode/mod-utils/v5 v5.23.3/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.4 h1:/lcKi1MJ2srGfNhCPtdnTRpQgdh2FNBRUAS7Ysz1W34= -github.com/gethinode/mod-utils/v5 v5.23.4/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= +github.com/gethinode/hinode/v2 v2.20.0 h1:WSfhRbJaK3NEB34T7dZMJhq8YvseBapn3cOFFYfXURs= +github.com/gethinode/hinode/v2 v2.20.0/go.mod h1:TgOeFsqFMU2iboO+iMk/JRq6yZiOQXWl/oXBtIm1+3w= diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 7581118..8d14584 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -1,9 +1,56 @@ baseURL = 'http://example.org/' -languageCode = 'en-us' title = 'Test site for mod-blocks' +defaultContentLanguage = 'en' +enableEmoji = true +timeout = '180s' + +[languages.en] + label = "English" + weight = 1 + [languages.en.params] + locale = 'en-US' + +[menus] + [[menus.main]] + name = 'Components' + pageRef = '/components' + weight = 10 + [menus.main.params] + icon = 'fas cubes' + description = 'One demo page per Bookshop component.' + [[menus.main]] + name = 'Blog' + pageRef = '/blog' + weight = 20 + [menus.main.params] + icon = 'fas newspaper' + description = 'Demo posts used by the articles and list components.' + [[menus.main]] + name = 'Team' + pageRef = '/team' + weight = 30 + [menus.main.params] + icon = 'fas users' + description = 'Demo team members used by the team component.' + [[menus.main]] + name = 'About' + pageRef = '/components/about' + weight = 40 + [menus.main.params] + icon = 'fas circle-info' + description = 'About the mod-blocks test site.' + +[params] + [params.style] + purge = false + [module] # Build and serve using local mod-blocks clone declared in the named Hugo workspace: workspace = "mod-blocks.work" [[module.imports]] path = "github.com/gethinode/mod-blocks" + # Hinode provides the shared partials (section-title, card-group, video, table, + # timeline, live-pages, ...) that the mod-blocks components call at site build time. + [[module.imports]] + path = "github.com/gethinode/hinode/v2" diff --git a/exampleSite/layouts/_default/baseof.html b/exampleSite/layouts/_default/baseof.html deleted file mode 100644 index dd8691c..0000000 --- a/exampleSite/layouts/_default/baseof.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - {{ with .Title }}{{ printf "%s | " . }}{{ end }}{{ site.Title }} - - - -{{ block "main" . }} - -{{ end }} - - \ No newline at end of file diff --git a/exampleSite/layouts/_default/home.html b/exampleSite/layouts/_default/home.html deleted file mode 100644 index fc8579b..0000000 --- a/exampleSite/layouts/_default/home.html +++ /dev/null @@ -1,16 +0,0 @@ -{{ define "main" }} -

{{ .Title }}

- {{ with .Params.details }} -

Details: {{ . }}

- {{ end }} - {{ with .Params.description }} -

Description: {{ . }}

- {{ end }} - {{ with or .Params.url .Params.details }} -
- {{ end }} - {{ .Content }} - {{ range .Site.RegularPages }} -

{{ .Title }}

- {{ end }} -{{ end }} diff --git a/exampleSite/layouts/_default/list.html b/exampleSite/layouts/_default/list.html deleted file mode 100644 index 7cf5e3e..0000000 --- a/exampleSite/layouts/_default/list.html +++ /dev/null @@ -1,7 +0,0 @@ -{{ define "main" }} -

{{ .Title }}

- {{ .Content }} - {{ range .Pages }} -

{{ .Title }}

- {{ end }} -{{ end }} diff --git a/exampleSite/layouts/_default/single.html b/exampleSite/layouts/_default/single.html deleted file mode 100644 index 4cfd224..0000000 --- a/exampleSite/layouts/_default/single.html +++ /dev/null @@ -1,4 +0,0 @@ -{{ define "main" }} -

{{ .Title }}

- {{ .Content }} -{{ end }} diff --git a/exampleSite/layouts/_partials/blocks/demo-form.html b/exampleSite/layouts/_partials/blocks/demo-form.html new file mode 100644 index 0000000..a9512f0 --- /dev/null +++ b/exampleSite/layouts/_partials/blocks/demo-form.html @@ -0,0 +1,21 @@ +{{/* + Demo form hook for the contact-form component. The component requires a site-provided + render hook that emits the actual form markup; this minimal hook exercises that path. +*/}} +{{- $action := .action -}} +{{- $formID := index . "form-id" | default "demo-form" -}} +
+
+ + +
+
+ + +
+
+ + +
+ +
diff --git a/exampleSite/mod-blocks.work.sum b/exampleSite/mod-blocks.work.sum new file mode 100644 index 0000000..e09490d --- /dev/null +++ b/exampleSite/mod-blocks.work.sum @@ -0,0 +1,28 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20260210181720-337dd2045d56 h1:wZEHFCO5SVesIEn1oBuo3ltK7stDYViJsNT2aGRSXN4= +github.com/FortAwesome/Font-Awesome v0.0.0-20260210181720-337dd2045d56/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/airbnb/lottie-web v5.13.0+incompatible h1:plBV5Uq/F1kK0EC61Hr0cBGReI9OgUfd/pp0baoDX8o= +github.com/airbnb/lottie-web v5.13.0+incompatible/go.mod h1:nTss557UK9FGnp8QYlCMO29tjUHwbdAHG/DprbGfHGE= +github.com/gethinode/mod-bootstrap v1.3.7 h1:rbjOg//q7dbsM+TkDQLsyk9LKv93D1RUjtcSkvV55UU= +github.com/gethinode/mod-bootstrap v1.3.7/go.mod h1:CxrYCFzKtBMz3YWG5i/d5jHKCgvUo60NFcCmz2mxCjQ= +github.com/gethinode/mod-csp v1.0.11 h1:kQKQWF0UL/RT8m5t+VBbTGyo2vTWmCwVXKrHDuCwCU4= +github.com/gethinode/mod-csp v1.0.11/go.mod h1:Nb22QMicoUHgZQUKP5TCgVrSI8K3KU7jLuLBShmotjg= +github.com/gethinode/mod-flexsearch/v4 v4.3.3 h1:/h900BK1zmfI3NQ/xp6srFNnPABiJhVaAg+xhiN+v1U= +github.com/gethinode/mod-flexsearch/v4 v4.3.3/go.mod h1:+aa5mmNfFHnqb30AoAWVRx/SQJMjEN98OleVMcmGLjA= +github.com/gethinode/mod-fontawesome/v5 v5.1.1 h1:zYjqzFMj2JdYyvRrigIAs8+LIspQ0XSRmi9f1orQm0Q= +github.com/gethinode/mod-fontawesome/v5 v5.1.1/go.mod h1:DZi1UIZLFO9Og2pkrsyTRad85PoFEEwSwiPd7kk28IA= +github.com/gethinode/mod-google-analytics/v2 v2.0.3 h1:G2uwsOmgpjNA0Zcftvzlz++qXCFb5DMn5e54H3GZnUA= +github.com/gethinode/mod-google-analytics/v2 v2.0.3/go.mod h1:y4ZlacA8FSXjmvn9P8cZshOrBB5Wc+3p0DKSehkk+8E= +github.com/gethinode/mod-katex v1.1.5 h1:Fp0BGdf3m9xWOQHx1hILi78gpNHRwdTpruQpLHpTCFw= +github.com/gethinode/mod-katex v1.1.5/go.mod h1:byAfpI3wuqNJIooTGVEGc1cjBhhCy4+CcK1H6495MYg= +github.com/gethinode/mod-leaflet/v2 v2.1.1 h1:8g0T9hN036LsCaXFkehDlzFbEpAlSYrzxSpbhSLrRr8= +github.com/gethinode/mod-leaflet/v2 v2.1.1/go.mod h1:A9Inp9uwSDD6vW8uYVVGl6eXGMe+j3ESOxV4T53HOaM= +github.com/gethinode/mod-lottie/v2 v2.1.2 h1:6ckLvZ/zCugdFtXSLeLviz38sTwAwYa1EuGqErcjyq0= +github.com/gethinode/mod-lottie/v2 v2.1.2/go.mod h1:9+IlgdD7WEmmrPM4OY8Uy66o86tv9MLR1lImDEiCcrw= +github.com/gethinode/mod-mermaid/v4 v4.10.1 h1:wXAvq48rMp7p4HXg03rI18cxPfmov4LWuUkcAM03sEA= +github.com/gethinode/mod-mermaid/v4 v4.10.1/go.mod h1:oZoG4GfNy3pjj7dvevrjXYjeJe86RHFaNN74z86e3V0= +github.com/gethinode/mod-simple-datatables/v3 v3.1.2 h1:EiZFezmLDKBsbUkhrZqTJlFWJ6vFV+HfdWNM8h/uY6s= +github.com/gethinode/mod-simple-datatables/v3 v3.1.2/go.mod h1:pUU1gcVUmNXgivo1SOFpcB3KYJhljQyfSnArROeIaZo= +github.com/nextapps-de/flexsearch v0.0.0-20260529083235-f7ed963096a0 h1:QDKcU3q39lFGzdVwM6kgCGnW3ibbMfYIi0Rwl62iJpo= +github.com/nextapps-de/flexsearch v0.0.0-20260529083235-f7ed963096a0/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU= +github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o= +github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/exampleSite/static/style.css b/exampleSite/static/style.css deleted file mode 100644 index e69de29..0000000 From 49181fc4b44c76259126c2b5238f762f11950d18 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Sun, 12 Jul 2026 16:18:32 +0200 Subject: [PATCH 2/2] feat: adopt the mod-utils v6 validation engine Bump the module path to github.com/gethinode/mod-blocks/v2 and require mod-utils v6.0.1. Migrate all 26 InitArgs call sites (19 Bookshop component wrappers and 7 layout partials) to the Args API with the strict-false guardrail for site-authored content. Remove fallbacks that v6 defaulting makes dead (illustration and heading widths, device, cols, contact width, legacy link_type chain) and fix the faq section component-name typo (faw). BREAKING CHANGE: requires github.com/gethinode/mod-blocks/v2 import path; adopts mod-utils v6 and migrates argument handling to the Args API (see gethinode/mod-utils v5-to-v6 migration notes). Co-Authored-By: Claude Fable 5 --- CLAUDE.md | 12 ++-- README.md | 6 +- .../components/about/about.hugo.html | 12 ++-- .../components/approach/approach.hugo.html | 12 ++-- .../components/articles/articles.hugo.html | 12 ++-- .../components/cards/cards.hugo.html | 12 ++-- .../contact-form/contact-form.hugo.html | 18 +++--- .../components/cta/cta.hugo.html | 12 ++-- .../components/faq/faq.hugo.html | 14 ++--- .../components/featured/featured.hugo.html | 12 ++-- .../components/heading/heading.hugo.html | 12 ++-- .../components/hero/hero.hugo.html | 12 ++-- .../components/list/list.hugo.html | 16 +++--- .../components/menu/menu.hugo.html | 12 ++-- .../components/panels/panels.hugo.html | 12 ++-- .../components/preview/preview.hugo.html | 12 ++-- .../components/releases/releases.hugo.html | 12 ++-- .../components/separator/separator.hugo.html | 14 ++--- .../components/team/team.hugo.html | 12 ++-- .../testimonials/testimonials.hugo.html | 12 ++-- .../video-message/video-message.hugo.html | 12 ++-- config.toml | 2 +- exampleSite/hugo.toml | 2 +- exampleSite/mod-blocks.work.sum | 2 + go.mod | 4 +- go.sum | 56 +------------------ layouts/partials/assets/contact.html | 13 +++-- layouts/partials/assets/faq.html | 11 ++-- layouts/partials/assets/hero.html | 16 +++--- layouts/partials/assets/menu.html | 13 +++-- layouts/partials/assets/preview.html | 13 +++-- .../partials/assets/testimonial-carousel.html | 13 +++-- layouts/partials/utilities/section.html | 11 ++-- 33 files changed, 187 insertions(+), 229 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 08f1286..6669853 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -74,7 +74,7 @@ All components follow the same structure: - `blueprint`: Component schema with default values 2. **Hugo Template** (`.hugo.html`): - - Cannot use InitArgs partial (Bookshop live editing requirement) + - Cannot use the Args partial (Bookshop live editing requirement) - Access arguments directly from dot notation (`.breadcrumb`, `.heading`, etc.) - Call mod-blocks partials like `assets/hero.html` (now owned by mod-blocks) - Call Hinode shared partials like `assets/card-group.html`, `assets/video.html` (still in Hinode) @@ -95,14 +95,14 @@ All components follow the same structure: - Page template: page/contact.html **Hinode provides (accessed via module inheritance):** -- mod-utils utilities: GetPadding, GetBreakpoint, LogWarn, InitArgs, etc. +- mod-utils utilities: GetPadding, GetBreakpoint, LogWarn, Args, etc. - Shared asset partials: card-group.html, video.html, table.html, timeline.html, live-image.html, section-title.html, etc. - Bootstrap styling and theming system **Dependency Flow:** ``` Hinode v2 (core theme) - ├── mod-utils (GetPadding, LogWarn, InitArgs, etc.) + ├── mod-utils (GetPadding, LogWarn, Args, etc.) ├── Shared partials (card-group, video, table, timeline, section-title) └── Bootstrap theming @@ -143,7 +143,7 @@ blueprint: ### 2. Hugo Partial Structures (`data/structures/*.yml`) — kebab-case -Structure files define the argument interface for **Hugo partials** (e.g., `assets/menu.html`, `assets/hero.html`). These are processed by `InitArgs` (mod-utils), which stores keys as-is and then camelizes any key containing `-`. **Always use kebab-case here** so that `$args.menuStyle`, `$args.linkType` etc. work correctly. +Structure files define the argument interface for **Hugo partials** (e.g., `assets/menu.html`, `assets/hero.html`). These are processed by `Args` (mod-utils v6), which returns a separated envelope with camelCase keys under `args`. **Always use kebab-case here** so that `$args.menuStyle`, `$args.linkType` etc. work correctly. ```yaml # data/structures/menu.yml @@ -153,7 +153,7 @@ arguments: icon-style: # → $args.iconStyle ``` -**Critical**: `InitArgs` does exact key matching against the structure. If the structure uses snake_case (`menu_style`) but the caller passes kebab-case (`"menu-style"`), `InitArgs` reports an unknown argument, sets `$error = true`, and breaks out of the range loop — potentially leaving required args (like `menu`) as nil, causing a runtime panic. +**Critical**: `Args` does exact key matching against the structure. If the structure uses snake_case (`menu_style`) but the caller passes kebab-case (`"menu-style"`), `Args` reports an unknown argument as an error — potentially leaving required args (like `menu`) as nil. ### 3. Hugo Template Dict Keys (`.hugo.html` → partials) — kebab-case @@ -171,7 +171,7 @@ When `.hugo.html` components call Hugo partials, they pass a dict with kebab-cas | Context | Key format | Example | Reason | |---|---|---|---| | `.bookshop.yml` blueprint | snake_case | `link_type` | CloudCannon CMS requirement | -| `data/structures/*.yml` | kebab-case | `link-type` | `InitArgs` camelizes `-` keys; `_` keys are NOT camelized | +| `data/structures/*.yml` | kebab-case | `link-type` | `Args` camelizes both `-` and `_` keys to camelCase | | Dict key passed to Hugo partial | kebab-case | `"link-type"` | Must match structure definition exactly | | Value read from bookshop context | `(or .snake (index . "kebab"))` | `(or .link_type (index . "link-type"))` | Backwards compatibility | diff --git a/README.md b/README.md index 062c9d8..03e0892 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Add mod-blocks to your Hinode site's `hugo.toml`: ```toml [[module.imports]] - path = "github.com/gethinode/mod-blocks" + path = "github.com/gethinode/mod-blocks/v2" ``` Then run: @@ -67,7 +67,7 @@ hugo mod get -u - **Hugo Extended** v0.147.6 or higher - **Hinode v2** for: - - mod-utils utilities (GetPadding, GetBreakpoint, LogWarn, InitArgs, etc.) + - mod-utils utilities (GetPadding, GetBreakpoint, LogWarn, Args, etc.) - Shared asset partials (card-group, video, table, timeline, etc.) ## Architecture @@ -96,7 +96,7 @@ Located in `component-library/components/`: ### Dependencies on Hinode mod-blocks depends on Hinode v2 for: -- **mod-utils utilities**: GetPadding, GetBreakpoint, LogWarn, InitArgs, etc. +- **mod-utils utilities**: GetPadding, GetBreakpoint, LogWarn, Args, etc. - **Shared asset partials**: card-group, video, table, timeline, live-image, section-title, etc. - **Bootstrap styling** and theming system diff --git a/component-library/components/about/about.hugo.html b/component-library/components/about/about.hugo.html index 19ebf7a..3bd715f 100644 --- a/component-library/components/about/about.hugo.html +++ b/component-library/components/about/about.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "about" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "about" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/about/about.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/approach/approach.hugo.html b/component-library/components/approach/approach.hugo.html index 0d5d34e..c44ed4d 100644 --- a/component-library/components/approach/approach.hugo.html +++ b/component-library/components/approach/approach.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -17,16 +17,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "approach" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "approach" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/approach/approach.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/articles/articles.hugo.html b/component-library/components/articles/articles.hugo.html index 7dd8815..4631ddd 100644 --- a/component-library/components/articles/articles.hugo.html +++ b/component-library/components/articles/articles.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "articles" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "articles" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/articles/articles.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/cards/cards.hugo.html b/component-library/components/cards/cards.hugo.html index 0f22d8c..23f036c 100644 --- a/component-library/components/cards/cards.hugo.html +++ b/component-library/components/cards/cards.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "cards" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "cards" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/cards/cards.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/contact-form/contact-form.hugo.html b/component-library/components/contact-form/contact-form.hugo.html index 8bac29a..82d4d45 100644 --- a/component-library/components/contact-form/contact-form.hugo.html +++ b/component-library/components/contact-form/contact-form.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -13,24 +13,24 @@ {{ $error := false }} {{ if not site.Params.env_bookshop_live }} {{ $bookshop := "contact-form" }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" $bookshop "args" .)}} - {{ $err := $args.err }} - {{ $msg := ($args.errmsg | append $args.warnmsg) }} + {{ $result := partial "utilities/Args.html" (dict "bookshop" $bookshop "args" . "strict" false) }} + {{ $err := $result.err }} + {{ $msg := ($result.errmsg | append $result.warnmsg) }} {{ if not $err }} - {{ if not $args.hook }} + {{ if not $result.args.hook }} {{ $msg = $msg | append (printf "[%s] requires argument 'hook'" $bookshop) }} {{ $err = true }} - {{ else if (not (templates.Exists (printf "_partials/%s" $args.hook))) }} - {{ $hook := cond (path.Ext $args.hook) $args.hook (printf "%s.html" $args.hook) }} + {{ else if (not (templates.Exists (printf "_partials/%s" $result.args.hook))) }} + {{ $hook := cond (path.Ext $result.args.hook) $result.args.hook (printf "%s.html" $result.args.hook) }} {{ if (not (templates.Exists (printf "_partials/%s" $hook))) }} - {{ $msg = $msg | append (printf "[%s] cannot find render hook '%s'" $bookshop $args.hook) }} + {{ $msg = $msg | append (printf "[%s] cannot find render hook '%s'" $bookshop $result.args.hook) }} {{ $err = true }} {{ end }} {{ end }} {{ end }} - {{ if or $err $args.warnmsg }} + {{ if or $err $result.warnmsg }} {{ partial (cond $err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/contact-form/contact-form.hugo.html" "warnid" "warn-invalid-arguments" diff --git a/component-library/components/cta/cta.hugo.html b/component-library/components/cta/cta.hugo.html index f260ec1..f5a48b7 100644 --- a/component-library/components/cta/cta.hugo.html +++ b/component-library/components/cta/cta.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "cta" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "cta" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/cta/cta.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/faq/faq.hugo.html b/component-library/components/faq/faq.hugo.html index 4b9deed..a8f5e90 100644 --- a/component-library/components/faq/faq.hugo.html +++ b/component-library/components/faq/faq.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "faq" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "faq" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/faq/faq.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} @@ -52,7 +52,7 @@ {{ if $raw }} {{ partial "utilities/section.html" (dict "_ordinal" ._ordinal - "component-name" "faw" + "component-name" "faq" "id" .id "raw" $raw "background" .background diff --git a/component-library/components/featured/featured.hugo.html b/component-library/components/featured/featured.hugo.html index bb8354a..dd1976e 100644 --- a/component-library/components/featured/featured.hugo.html +++ b/component-library/components/featured/featured.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "featured" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "featured" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/featured/featured.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/heading/heading.hugo.html b/component-library/components/heading/heading.hugo.html index 0a0dd6b..aa551f3 100644 --- a/component-library/components/heading/heading.hugo.html +++ b/component-library/components/heading/heading.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "heading" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "heading" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/heading/heading.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/hero/hero.hugo.html b/component-library/components/hero/hero.hugo.html index c05ac67..b1ae2a6 100644 --- a/component-library/components/hero/hero.hugo.html +++ b/component-library/components/hero/hero.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "hero" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "hero" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/hero/hero.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/list/list.hugo.html b/component-library/components/list/list.hugo.html index 92ec30c..fcb3028 100644 --- a/component-library/components/list/list.hugo.html +++ b/component-library/components/list/list.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -13,19 +13,19 @@ {{ $error := false }} {{ if not site.Params.env_bookshop_live }} {{ $bookshop := "list" }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" $bookshop "args" .) }} - {{ $err := $args.err }} - {{ $msg := ($args.errmsg | append $args.warnmsg) }} + {{ $result := partial "utilities/Args.html" (dict "bookshop" $bookshop "args" . "strict" false) }} + {{ $err := $result.err }} + {{ $msg := ($result.errmsg | append $result.warnmsg) }} - {{ if and (not $err) $args.hook }} - {{ $hook := cond (path.Ext $args.hook) $args.hook (printf "%s.html" $args.hook) }} + {{ if and (not $err) $result.args.hook }} + {{ $hook := cond (path.Ext $result.args.hook) $result.args.hook (printf "%s.html" $result.args.hook) }} {{ if (not (templates.Exists (printf "_partials/%s" $hook))) }} - {{ $msg = $msg | append (printf "[%s] cannot find render hook '%s'" $bookshop $args.hook) }} + {{ $msg = $msg | append (printf "[%s] cannot find render hook '%s'" $bookshop $result.args.hook) }} {{ $err = true }} {{ end }} {{ end }} - {{ if or $err $args.warnmsg }} + {{ if or $err $result.warnmsg }} {{ partial (cond $err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/list/list.hugo.html" "warnid" "warn-invalid-arguments" diff --git a/component-library/components/menu/menu.hugo.html b/component-library/components/menu/menu.hugo.html index cc21edc..1f91810 100644 --- a/component-library/components/menu/menu.hugo.html +++ b/component-library/components/menu/menu.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "menu" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "menu" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/menu/menu.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/panels/panels.hugo.html b/component-library/components/panels/panels.hugo.html index a25e129..d9a3f47 100644 --- a/component-library/components/panels/panels.hugo.html +++ b/component-library/components/panels/panels.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "panels" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "panels" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/panels/panels.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/preview/preview.hugo.html b/component-library/components/preview/preview.hugo.html index d3bea9b..4bb5c90 100644 --- a/component-library/components/preview/preview.hugo.html +++ b/component-library/components/preview/preview.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "preview" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "preview" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/preview/preview.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/releases/releases.hugo.html b/component-library/components/releases/releases.hugo.html index 7711ca8..8384b63 100644 --- a/component-library/components/releases/releases.hugo.html +++ b/component-library/components/releases/releases.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "releases" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "releases" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/releases/releases.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/separator/separator.hugo.html b/component-library/components/separator/separator.hugo.html index e447536..9cf1ae8 100644 --- a/component-library/components/separator/separator.hugo.html +++ b/component-library/components/separator/separator.hugo.html @@ -9,19 +9,19 @@ {{ $id := .id }} {{ $clear := .clear }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "separator" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "separator" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/separator/separator.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ else }} - {{ $id = $args.id }} - {{ $clear = $args.clear }} + {{ $id = $result.args.id }} + {{ $clear = $result.args.clear }} {{- end -}} {{- end -}} diff --git a/component-library/components/team/team.hugo.html b/component-library/components/team/team.hugo.html index 6cd0d07..d120567 100644 --- a/component-library/components/team/team.hugo.html +++ b/component-library/components/team/team.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "team" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "team" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/team/team.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/testimonials/testimonials.hugo.html b/component-library/components/testimonials/testimonials.hugo.html index 4ee1fe2..adb1332 100644 --- a/component-library/components/testimonials/testimonials.hugo.html +++ b/component-library/components/testimonials/testimonials.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -12,16 +12,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "testimonials" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "testimonials" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/testimonials/testimonials.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/component-library/components/video-message/video-message.hugo.html b/component-library/components/video-message/video-message.hugo.html index 6942b06..1b836c4 100644 --- a/component-library/components/video-message/video-message.hugo.html +++ b/component-library/components/video-message/video-message.hugo.html @@ -4,7 +4,7 @@ Visit gethinode.com/license for more details. Note: To support live editing, bookshop components should use a clear path to the provided arguments. - Therefore, we cannot use the InitArgs partial at this point, and we need to access each argument + Therefore, we cannot use the validated arguments (Args partial) at this point, and we need to access each argument directly. See the docs for more background: https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components */}} @@ -108,16 +108,16 @@ {{/* Validate arguments */}} {{ $error := false }} {{ if not site.Params.env_bookshop_live }} - {{ $args := partial "utilities/InitArgs.html" (dict "bookshop" "video-message" "args" .) }} - {{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict + {{ $result := partial "utilities/Args.html" (dict "bookshop" "video-message" "args" . "strict" false) }} + {{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "component-library/components/video-message/video-message.hugo.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{- end -}} {{- end -}} diff --git a/config.toml b/config.toml index da701ae..1234efc 100644 --- a/config.toml +++ b/config.toml @@ -65,7 +65,7 @@ # Import common Hinode utitilies [[module.imports]] - path = "github.com/gethinode/mod-utils/v5" + path = "github.com/gethinode/mod-utils/v6" # Icon defaults for mod-blocks components [params.icons] diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 8d14584..c9c452d 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -49,7 +49,7 @@ timeout = '180s' # Build and serve using local mod-blocks clone declared in the named Hugo workspace: workspace = "mod-blocks.work" [[module.imports]] - path = "github.com/gethinode/mod-blocks" + path = "github.com/gethinode/mod-blocks/v2" # Hinode provides the shared partials (section-title, card-group, video, table, # timeline, live-pages, ...) that the mod-blocks components call at site build time. [[module.imports]] diff --git a/exampleSite/mod-blocks.work.sum b/exampleSite/mod-blocks.work.sum index e09490d..b5e7ad1 100644 --- a/exampleSite/mod-blocks.work.sum +++ b/exampleSite/mod-blocks.work.sum @@ -22,6 +22,8 @@ github.com/gethinode/mod-mermaid/v4 v4.10.1 h1:wXAvq48rMp7p4HXg03rI18cxPfmov4LWu github.com/gethinode/mod-mermaid/v4 v4.10.1/go.mod h1:oZoG4GfNy3pjj7dvevrjXYjeJe86RHFaNN74z86e3V0= github.com/gethinode/mod-simple-datatables/v3 v3.1.2 h1:EiZFezmLDKBsbUkhrZqTJlFWJ6vFV+HfdWNM8h/uY6s= github.com/gethinode/mod-simple-datatables/v3 v3.1.2/go.mod h1:pUU1gcVUmNXgivo1SOFpcB3KYJhljQyfSnArROeIaZo= +github.com/gethinode/mod-utils/v5 v5.24.0 h1:dqqRn6qaEehEHZjo74pxbzvVdCn++XuZk18jxeUvwwA= +github.com/gethinode/mod-utils/v5 v5.24.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= github.com/nextapps-de/flexsearch v0.0.0-20260529083235-f7ed963096a0 h1:QDKcU3q39lFGzdVwM6kgCGnW3ibbMfYIi0Rwl62iJpo= github.com/nextapps-de/flexsearch v0.0.0-20260529083235-f7ed963096a0/go.mod h1:5GdMfPAXzbA2gXBqTjC6l27kioSYzHlqDMh0+wyx7sU= github.com/twbs/bootstrap v5.3.8+incompatible h1:eK1fsXP7R/FWFt+sSNmmvUH9usPocf240nWVw7Dh02o= diff --git a/go.mod b/go.mod index 58cff16..1bba5f0 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ -module github.com/gethinode/mod-blocks +module github.com/gethinode/mod-blocks/v2 go 1.19 require ( github.com/cloudcannon/bookshop/hugo/v3 v3.18.5 // indirect - github.com/gethinode/mod-utils/v5 v5.24.0 // indirect + github.com/gethinode/mod-utils/v6 v6.0.1 // indirect ) diff --git a/go.sum b/go.sum index 7bc570b..104e39f 100644 --- a/go.sum +++ b/go.sum @@ -1,56 +1,4 @@ -github.com/cloudcannon/bookshop/hugo/v3 v3.17.1 h1:weTVWBamjQHMIp/oYTFsPwRzzhWrZA6JO43QnxI1kxw= -github.com/cloudcannon/bookshop/hugo/v3 v3.17.1/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.0 h1:Hy4UrNwvXBC1TiTmsGnYp8T1VLbdK/NBNvj7HphLBpI= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.0/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.2 h1:j3XUvvuCv/7SfGKzd7gzb3WEgs1DurqTRDe7gdMAAvU= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.2/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.3 h1:HMhrR7gkQt/cvOfSl64TgaBsD3mLLD/dAFVLLaj2boQ= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.3/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.4 h1:mZCALkYdpXKUrw7O1WtLcL5FSFt7nt5HXvs+TczRHf0= -github.com/cloudcannon/bookshop/hugo/v3 v3.18.4/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= github.com/cloudcannon/bookshop/hugo/v3 v3.18.5 h1:AKWzUQpWcBSbJgHQ/5cfPQtGX40bn8vbHBGk4rlHEGE= github.com/cloudcannon/bookshop/hugo/v3 v3.18.5/go.mod h1:s7mIonDhtsLcn10ZKuVXyqd6BDHI8vT1WQhZw8rPfY8= -github.com/gethinode/mod-utils/v5 v5.10.0 h1:NlofAfa1YILV9pwS8vMkEwVUdrnKCoIlVwJPm3+UVGs= -github.com/gethinode/mod-utils/v5 v5.10.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.11.0 h1:1BO9uK0zecHF6dNJcqX8NFNHSIdizlyj88n9ylLUsDc= -github.com/gethinode/mod-utils/v5 v5.11.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.11.1 h1:LfVXEh3dYwIFNyL4i3R9YinfN1yf1PQTivKQ2sUsCQY= -github.com/gethinode/mod-utils/v5 v5.11.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.12.0 h1:XH6/MsvgPfYVD8Ci3t20vRH3Zz1JpaqqG6X0/j3mRSE= -github.com/gethinode/mod-utils/v5 v5.12.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.13.0 h1:ztkE1REey94x36UdlZ7yeitpIQid/BcZQh+wtxBTSQ8= -github.com/gethinode/mod-utils/v5 v5.13.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.14.0 h1:Nntb2ei7yTRsUmGMUHo/fgCfacIk+GD/ZbSW64gu6HM= -github.com/gethinode/mod-utils/v5 v5.14.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.15.0 h1:8X/QT/O/OQaN6IISVg9C4/mp/DIr2+q+ofM7Ll3pLT8= -github.com/gethinode/mod-utils/v5 v5.15.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.15.1 h1:DE3zpIdHznpI7xOB8u+++MQHr4mdGE/WdAa7/M0lKC4= -github.com/gethinode/mod-utils/v5 v5.15.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.16.0 h1:RqZZKJ3cyjwCyjrzH93FBnI7zQgr+RZaSRQUAq3D3uI= -github.com/gethinode/mod-utils/v5 v5.16.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.16.1 h1:WzE+xFKmOGX5zAhJ/udR0BFMEiGSbFVLBX/s/n58Rmo= -github.com/gethinode/mod-utils/v5 v5.16.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.17.0 h1:qwOGyfWWmaSTQBaYrhRNYN/ATuTZ7XXOeAjLETxMGR0= -github.com/gethinode/mod-utils/v5 v5.17.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.18.0 h1:qRdwc7f+heVPJJh+383QgAYFc9i2jKHAr35ozawM9fI= -github.com/gethinode/mod-utils/v5 v5.18.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.19.0 h1:fX3gTsYoimUNqD/KeBsyBrrJ2DygQ0M7Rc8gL1HT5Tc= -github.com/gethinode/mod-utils/v5 v5.19.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.19.1 h1:peyYRxjIf8d84mt435veKaiO5nrIBXQ5xrHKHqcJehw= -github.com/gethinode/mod-utils/v5 v5.19.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.20.0 h1:K+oBv8kJ4pVj4m1HlxgJiC+DYNX4oumqS6Cvcp2C8Ho= -github.com/gethinode/mod-utils/v5 v5.20.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.22.0 h1:zVTzU4BQjqWcA4wrpvjrgxyLOHO+jxdLKiIiYMwbMV8= -github.com/gethinode/mod-utils/v5 v5.22.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.0 h1:PW4ceewrDiO7k3zVjtiLeyrKnAR4UEAxaXH6ja8CNSs= -github.com/gethinode/mod-utils/v5 v5.23.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.1 h1:Y6c+039rk8vA2m4t739osgDrXbQe3SHX9mF7K0mZSmI= -github.com/gethinode/mod-utils/v5 v5.23.1/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.2 h1:d89TkxTYeOVFdOpCtESmnXE7hQs53zxCwAIes4yNu1E= -github.com/gethinode/mod-utils/v5 v5.23.2/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.3 h1:ifcDyTYpmM6HBzc6SbpG+hJMSCfGTZKf/plgjVW2qZ4= -github.com/gethinode/mod-utils/v5 v5.23.3/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.23.4 h1:/lcKi1MJ2srGfNhCPtdnTRpQgdh2FNBRUAS7Ysz1W34= -github.com/gethinode/mod-utils/v5 v5.23.4/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= -github.com/gethinode/mod-utils/v5 v5.24.0 h1:dqqRn6qaEehEHZjo74pxbzvVdCn++XuZk18jxeUvwwA= -github.com/gethinode/mod-utils/v5 v5.24.0/go.mod h1:PwQN4oOjA6k/vet11JueJ9asZMgL0DBa3jyS9tPkBWU= +github.com/gethinode/mod-utils/v6 v6.0.1 h1:EnmMHjqnI/xyHPXFj1SdRLfVxNunJcKLGVtSAAFTQ8w= +github.com/gethinode/mod-utils/v6 v6.0.1/go.mod h1:E5tO9w3VKaidJpu1nI8zAKmh0bddFHOIIQnudAaXQTs= diff --git a/layouts/partials/assets/contact.html b/layouts/partials/assets/contact.html index 4b2b8e4..219f1e1 100644 --- a/layouts/partials/assets/contact.html +++ b/layouts/partials/assets/contact.html @@ -5,19 +5,20 @@ */}} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "contact" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "contact" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/contact.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} {{ end }} {{/* Main code */}} -{{ if not $args.err }} +{{ if not $result.err }} {{ $illustration := dict }} {{ if site.Params.env_bookshop_live }} {{ $illustration = dict @@ -71,7 +72,7 @@ "link-type" $args.linkType "links" $args.links "orientation" $args.orientation - "width" (or $args.width 12) + "width" $args.width "use-title" false "size" 6 "heading-style" "fs" diff --git a/layouts/partials/assets/faq.html b/layouts/partials/assets/faq.html index 119c78f..6069daa 100644 --- a/layouts/partials/assets/faq.html +++ b/layouts/partials/assets/faq.html @@ -7,16 +7,17 @@ {{ $error := false }} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "faq" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "faq" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/faq.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ end }} {{ if not $error }} diff --git a/layouts/partials/assets/hero.html b/layouts/partials/assets/hero.html index 7a0a45f..424c08f 100644 --- a/layouts/partials/assets/hero.html +++ b/layouts/partials/assets/hero.html @@ -7,16 +7,17 @@ {{ $error := false }} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "hero" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "hero" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/hero.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ end }} {{/* Initialize global variables */}} @@ -42,7 +43,8 @@ Only applies to horizontal orientation; stacked uses $scale for the image wrapper instead. */}} {{ $imgColWidth := 12 }} {{ if eq $args.orientation "horizontal" }} - {{ $imgColWidth = sub 12 (or $args.heading.width 8) }} + {{/* heading.width is filled by the argument engine (default 8) at any nesting depth */}} + {{ $imgColWidth = sub 12 $args.heading.width }} {{ if lt $imgColWidth 1 }}{{ $imgColWidth = 1 }}{{ end }} {{ end }} @@ -117,7 +119,7 @@ "heading" $heading "use-title" $args.useTitle "links" $args.links - "link-type" (or $args.linkType $args.link_type $args.type) + "link-type" $args.linkType "class" "hero-title" "arrangement" $arrangement "justify" $args.justify diff --git a/layouts/partials/assets/menu.html b/layouts/partials/assets/menu.html index f095cbc..238afbd 100644 --- a/layouts/partials/assets/menu.html +++ b/layouts/partials/assets/menu.html @@ -7,16 +7,17 @@ {{ $error := false }} {{/* Initialize arguments */}} -{{- $args := partial "utilities/InitArgs.html" (dict "structure" "menu" "args" . "group" "partial") -}} -{{- if or $args.err $args.warnmsg -}} - {{- partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{- $result := partial "utilities/Args.html" (dict "structure" "menu" "args" . "group" "partial" "strict" false) -}} +{{- $args := $result.args -}} +{{- if or $result.err $result.warnmsg -}} + {{- partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/menu.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File ) -}} - {{- $error = $args.err -}} + {{- $error = $result.err -}} {{- end -}} {{/* Initialize global arguments */}} @@ -25,7 +26,7 @@ {{/* Initialize local arguments */}} {{- $menu := index site.Menus $args.menu -}} {{- if or (ne (printf "%T" $menu) "navigation.Menu") (ne (index $menu 0).Menu $args.menu) -}} - {{- if not (in $args.default "menu") }} + {{- if not (in $result.defaulted "menu") }} {{- errorf "partial [assets/menu.html] - Invalid value for param 'menus': %s" $args.menu -}} {{- end -}} {{- end -}} diff --git a/layouts/partials/assets/preview.html b/layouts/partials/assets/preview.html index eca1288..dc218af 100644 --- a/layouts/partials/assets/preview.html +++ b/layouts/partials/assets/preview.html @@ -37,16 +37,17 @@ {{ $error := false }} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "preview" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "preview" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/preview.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ end }} {{- if and (not $error) (not $args.url) (not $args.image) -}} @@ -69,7 +70,7 @@ {{/* Initialize local variables */}} {{- $devices := slice "desktop" "tablet" "mobile" -}} -{{- $defaultDevice := $args.device | default "desktop" -}} +{{- $defaultDevice := $args.device -}} {{- $id := printf "preview-%s" (md5 (delimit (slice . now) "-")) -}} {{- $controlsBelow := eq $args.controlsPlacement "bottom" -}} diff --git a/layouts/partials/assets/testimonial-carousel.html b/layouts/partials/assets/testimonial-carousel.html index 673ac9f..71bbbe3 100644 --- a/layouts/partials/assets/testimonial-carousel.html +++ b/layouts/partials/assets/testimonial-carousel.html @@ -7,16 +7,17 @@ {{ $error := false }} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "testimonial-carousel" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "testimonial-carousel" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "assets/testimonial-carousel.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} - {{ $error = $args.err }} + {{ $error = $result.err }} {{ end }} {{/* Initialize global variables */}} @@ -26,7 +27,7 @@ {{- $carouselNext := partial "utilities/GetThemeIcon.html" (dict "id" "carouselNext" "default" "fas chevron-right") -}} {{/* Initialize local variables */}} -{{ $colGrid := printf "row-cols-%d" ($args.cols | default 1) }} +{{ $colGrid := printf "row-cols-%d" $args.cols }} {{ if $args.responsive }} {{- if eq $args.cols 1 }} {{ $colGrid = "row-cols-1" -}} diff --git a/layouts/partials/utilities/section.html b/layouts/partials/utilities/section.html index 66dcd99..961f46f 100644 --- a/layouts/partials/utilities/section.html +++ b/layouts/partials/utilities/section.html @@ -5,13 +5,14 @@ */}} {{/* Initialize arguments */}} -{{ $args := partial "utilities/InitArgs.html" (dict "structure" "section" "args" . "group" "partial") }} -{{ if or $args.err $args.warnmsg }} - {{ partial (cond $args.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict +{{ $result := partial "utilities/Args.html" (dict "structure" "section" "args" . "group" "partial" "strict" false) }} +{{ $args := $result.args }} +{{ if or $result.err $result.warnmsg }} + {{ partial (cond $result.err "utilities/LogErr.html" "utilities/LogWarn.html") (dict "partial" "utilities/section.html" "warnid" "warn-invalid-arguments" "msg" "Invalid arguments" - "details" ($args.errmsg | append $args.warnmsg) + "details" ($result.errmsg | append $result.warnmsg) "file" page.File )}} {{ end }} @@ -21,7 +22,7 @@ {{- $paddingTop := and $embed (eq $args._ordinal 0) }} {{/* Main code */}} -{{ if not $args.err }} +{{ if not $result.err }} {{- $pxClasses := partial "utilities/PaddingClasses.html" (dict "padding" $padding "axis" "x") -}} {{- $pyClasses := partial "utilities/PaddingClasses.html" (dict "padding" $padding "axis" "y" "prefix" (cond $paddingTop "pb" "py")) -}} {{- $containerPadding := printf "%s %s%s" $pxClasses (cond $args.fluid "px-xxl-0 " "") $pyClasses -}}