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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2025 Mark Dumay
Copyright (c) 2022 - 2026 Hinode Team / Mark Dumay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion component-library/components/about/about.bookshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ blueprint:
order:
width:
justify:
link-type:
link_type:
fluid:
theme:
cover:
Expand Down
62 changes: 35 additions & 27 deletions component-library/components/about/about.hugo.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
{{/*
Copyright © 2025 The Hinode Team / Mark Dumay. All rights reserved.
Copyright © 2025 - 2026 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
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
directly. See the docs for more background:
https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components
*/}}

{{/* Initialize arguments */}}
{{ $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
"partial" "component-library/components/about/about.hugo.html"
"warnid" "warn-invalid-arguments"
"msg" "Invalid arguments"
"details" ($args.errmsg | append $args.warnmsg)
"file" page.File
)}}
{{- end -}}
{{ $raw := partial "assets/hero.html" (dict
"page" page
"heading" (merge (dict "width" 8) .heading)
"illustration" (merge (dict "ratio" "auto") .illustration)
"order" .order
"link-type" (or .link_type (index . "link-type"))
"links" .links
"orientation" "horizontal"
"width" (.width | default 8)
)
}}

{{/* Main code */}}
{{ if not $args.error }}
{{ partial "assets/hero.html" (dict
"page" page
"heading" (merge (dict "width" 8) $args.heading)
"background" $args.background
"illustration" (merge (dict "ratio" "auto") $args.illustration)
"order" $args.order
"link-type" $args.linkType
"links" $args.links
"orientation" "horizontal"
"width" (or $args.width 8)
)
}}
{{- end -}}
<!-- TODO: adjust width behavior -->
{{ if $raw }}
{{ partial "utilities/section.html" (dict
"component-name" "about"
"id" .id
"raw" $raw
"background" .background
"width" 12
"justify" .justify
"wrapper" .wrapper
"fluid" .fluid
"theme" .theme
"cover" .cover
"overlay-mode" (or .overlay_mode (index . "overlay-mode"))
"section-class" (or .section_class (index . "section-class"))
"bg-class" (or .bg_class (index . "bg-class"))
)}}
{{ end }}
6 changes: 3 additions & 3 deletions component-library/components/approach/approach.bookshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ blueprint:
align:
width:
cols:
icon-rounded:
icon-style:
link-type:
icon_rounded:
icon_style:
link_type:
padding:
background:
backdrop:
Expand Down
132 changes: 69 additions & 63 deletions component-library/components/approach/approach.hugo.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
{{/*
Copyright © 2025 The Hinode Team / Mark Dumay. All rights reserved.
Copyright © 2025 - 2026 The Hinode Team / Mark Dumay. All rights reserved.
Use of this source code is governed by The MIT License (MIT) that can be found in the LICENSE file.
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
directly. See the docs for more background:
https://github.com/CloudCannon/bookshop/blob/main/guides/hugo.adoc#passing-data-to-bookshop-components
*/}}

{{/*
This component is derived from the cards component. It inserts a featured illustration in between
the section title and the card group.
*/}}

{{ $error := false }}

{{/* Initialize arguments */}}
{{ $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
"partial" "component-library/components/approach/approach.hugo.html"
"warnid" "warn-invalid-arguments"
"msg" "Invalid arguments"
"details" ($args.errmsg | append $args.warnmsg)
"file" page.File
)}}
{{ $error = $args.err }}
{{ end }}

{{/* Initialize global arguments */}}
{{- $breakpoint := partial "utilities/GetBreakpoint.html" -}}
{{- $padding := partial "utilities/GetPadding.html" -}}

{{/* Initialize local variables */}}
{{ $raw := "" }}
{{ $list := slice }}
{{ range $args.elements }}
{{ range .elements }}
<!-- TODO: check mode -->
{{ $list = $list | append (dict
"title" .title
Expand All @@ -43,53 +34,68 @@
) }}
{{ end}}

{{/* Main code */}}
{{ if not $error }}
{{- partial "assets/section-title.html" (dict
"heading" $args.heading
"justify" $args.justify
"class" (printf "pb-%d" $padding.y))
-}}
{{- $raw = printf "%s%s" $raw (partial "assets/section-title.html" (dict
"heading" .heading
"justify" .justify
"class" (printf "pb-%d" $padding.y)))
-}}

{{/* Add featured illustration */}}
{{ with .illustration }}
{{ partial "assets/featured-illustration.html" (dict
"page" page
"image" .image
"ratio" (or .ratio "21x9")
"anchor" .anchor
"title" page.Title
"wrapper" "mb-5 col-12 col-md-8 mx-auto"
"mode" .mode
) }}
{{ end }}
{{/* Add featured illustration */}}
{{ with .illustration }}
{{ $raw = printf "%s%s" $raw (partial "assets/featured-illustration.html" (dict
"page" page
"image" .image
"ratio" (or .ratio "21x9")
"anchor" .anchor
"title" page.Title
"wrapper" "mb-5 col-12 col-md-8 mx-auto"
"mode" .mode
)) }}
{{ end }}

{{/* Init base arguments for card group */}}
{{ $params := dict
"page" page
"list" $list
"class" (printf "border-0 card-icon-primary %s" (or $args.class ""))
"cols" $args.cols
"gutter" "4"
"padding" $args.padding
"header-style" "none"
"footer-style" "none"
"icon-rounded" $args.iconRounded
"icon-style" (or $args.iconStyle "fa-2x")
"link-type" $args.linkType
"align" $args.align
"hook" "assets/live-card.html"
}}
{{/* Init base arguments for card group */}}
{{ $params := dict
"page" page
"list" $list
"class" (printf "border-0 card-icon-primary %s" (or .class ""))
"cols" .cols
"gutter" "4"
"padding" .padding
"header-style" "none"
"footer-style" "none"
"icon-rounded" .icon_rounded
"icon-style" (or .icon_style "fa-2x")
"link-type" .link_type
"align" .align
"hook" "assets/live-card.html"
}}

{{/* Layout for small screens */}}
{{- partial "assets/card-group.html" (merge $params (dict
"orientation" ($args.orientation | default "horizontal-sm")
"wrapper" (printf "d-%s-none" $breakpoint.prev)
)) -}}
{{/* Layout for small screens */}}
{{- $raw = printf "%s%s" $raw (partial "assets/card-group.html" (merge $params (dict
"orientation" (.orientation | default "horizontal-sm")
"wrapper" (printf "d-%s-none" $breakpoint.prev)
))) -}}

{{/* Layout for regular screens */}}
{{- partial "assets/card-group.html" (merge $params (dict
"orientation" ($args.orientation | default "stacked")
"wrapper" (printf "d-none d-%s-block" $breakpoint.prev)
)) -}}
{{ end }}
{{/* Layout for regular screens */}}
{{- $raw = printf "%s%s" $raw (partial "assets/card-group.html" (merge $params (dict
"orientation" (.orientation | default "stacked")
"wrapper" (printf "d-none d-%s-block" $breakpoint.prev)
))) -}}

{{ if $raw }}
{{ partial "utilities/section.html" (dict
"component-name" "approach"
"id" .id
"raw" $raw
"background" .background
"width" .width
"justify" .justify
"wrapper" .wrapper
"fluid" .fluid
"theme" .theme
"cover" .cover
"overlay-mode" (or .overlay_mode (index . "overlay-mode"))
"section-class" (or .section_class (index . "section-class"))
"bg-class" (or .bg_class (index . "bg-class"))
)}}
{{ end }}
14 changes: 7 additions & 7 deletions component-library/components/articles/articles.bookshop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ blueprint:
content:
align:
width:
hide-empty:
hide_empty:
input:
section:
nested:
Expand All @@ -27,10 +27,10 @@ blueprint:
more:
title:
link:
link-type:
link_type:
icon:
icon-rounded:
icon-style:
icon_rounded:
icon_style:
cols:
padding:
limit:
Expand All @@ -50,9 +50,9 @@ blueprint:
portrait:
width:
cover:
header-style:
body-style:
footer-style:
header_style:
body_style:
footer_style:
orientation:
class:
width:
Expand Down
Loading