diff --git a/themes/bonsai/exampleSite/content/variants/index.md b/themes/bonsai/exampleSite/content/variants/index.md new file mode 100644 index 0000000..9e02533 --- /dev/null +++ b/themes/bonsai/exampleSite/content/variants/index.md @@ -0,0 +1,4 @@ +--- +title: "Layout variants" +type: variants +--- diff --git a/themes/bonsai/exampleSite/hugo.toml b/themes/bonsai/exampleSite/hugo.toml index 76aacef..55f25cb 100644 --- a/themes/bonsai/exampleSite/hugo.toml +++ b/themes/bonsai/exampleSite/hugo.toml @@ -13,9 +13,11 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "404"] # avatar omitted intentionally so the demo showcases the initials fallback # (the SVG circle uses the active palette's accent color) colorTheme = "sakura" # try "bonsai" (default), "sakura", "sumi", "koi" + layout = "grid" # try "stack" (default), "grid", "inline" themeToggle = true jobTitle = "Software Engineer" footerText = "© 2026 · made with bonsai" + # ogImageUrl = "/og.png" # optional 1200×630 image for social previews [[params.links]] title = "GitHub" diff --git a/themes/bonsai/layouts/partials/bio-card.html b/themes/bonsai/layouts/partials/bio-card.html index 7e7304f..732afa2 100644 --- a/themes/bonsai/layouts/partials/bio-card.html +++ b/themes/bonsai/layouts/partials/bio-card.html @@ -2,6 +2,12 @@ {{- $tagline := site.Params.tagline -}} {{- $bio := site.Params.bio -}} {{- $links := site.Params.links -}} +{{- $layout := site.Params.layout | default "stack" -}} +{{- $validLayouts := slice "stack" "grid" "inline" -}} +{{- if not (in $validLayouts $layout) -}} + {{- warnf "bonsai: unknown params.layout %q (expected stack|grid|inline), falling back to 'stack'" $layout -}} + {{- $layout = "stack" -}} +{{- end -}}
{{ partial "avatar.html" . }} @@ -17,7 +23,7 @@ {{- end }} {{- if $links }} -