diff --git a/themes/bonsai/CHANGELOG.md b/themes/bonsai/CHANGELOG.md index 513623c..c364edf 100644 --- a/themes/bonsai/CHANGELOG.md +++ b/themes/bonsai/CHANGELOG.md @@ -5,7 +5,24 @@ All notable changes to this project are documented here. Format follows [Keep a ## [Unreleased] ### Added -- (placeholder for v0.2 — layout variants, color presets, schema.org Person markup) +- (placeholder for v0.3 — layout variants, i18n support) + +## [0.2.0] — 2026-05-03 + +Polish & SEO release. All additions are strictly opt-in; v0.1 sites upgrade with no config edits. + +### Added +- **Color theme presets** — four named palettes (`bonsai` default, `sakura`, `sumi`, `koi`); select via new `params.colorTheme`. Each has light + dark variants. Gallery at `/themes/`. +- **schema.org Person markup** — JSON-LD `ProfilePage > Person` injected in ``. Built from existing params + optional `params.jobTitle`, `params.location`, `params.email`. Suppressible via `params.schema = false`. `mailto:` and `tel:` links excluded from `sameAs`. +- **Theme toggle UI button** — sun/moon button rendered in footer when `params.themeToggle = true`. Sun shown in dark mode, moon in light (button shows target). `aria-pressed` reflects state. Existing localStorage persistence preserved. +- **Avatar initials fallback** — when `params.avatar` is unset, theme renders an inline SVG circle with auto-derived initials (first letter of up to 2 words from `params.name`). Override with `params.avatarInitials`. Background overrideable via `params.avatarBg`. + +### Changed +- `static/css/bonsai.css` restructured — color vars now scoped per `[data-bonsai-theme]`; layout vars (radius/gap/pad/fonts) stay in `:root`. +- `layouts/_default/baseof.html` emits `data-bonsai-theme` attribute on ``. +- `layouts/partials/bio-card.html` delegates avatar rendering to new `partials/avatar.html`. +- `static/js/theme-toggle.js` syncs `aria-pressed` on first paint and on click. +- `exampleSite/hugo.toml` switches demo to `colorTheme = "sakura"` to showcase a non-default palette. ## [0.1.0] — 2026-05-01 diff --git a/themes/bonsai/README.md b/themes/bonsai/README.md index c082591..0212f7b 100644 --- a/themes/bonsai/README.md +++ b/themes/bonsai/README.md @@ -88,9 +88,16 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "404"] | `name` | string | site `title` | Display name shown as `

`. | | `tagline` | string | — | One-liner under the name. | | `bio` | string (markdown) | — | Short bio paragraph. Markdown supported. | -| `avatar` | string (URL) | — | Avatar image path. Omit to skip. | +| `avatar` | string (URL) | — | Avatar image path. If unset, theme renders an SVG circle with auto-derived initials. | +| `avatarInitials` | string | first letters of `name` | Override the initials when no `avatar` is set. | +| `avatarBg` | string (CSS color) | `var(--bonsai-accent)` | Background color of the initials circle. | | `favicon` | string (URL) | `/favicon.ico` | Favicon path. | -| `themeToggle` | bool | `false` | Render the light/dark toggle button + load the toggle script. | +| `colorTheme` | string | `bonsai` | Palette: `bonsai`, `sakura`, `sumi`, or `koi`. See [Color themes](#color-themes). | +| `themeToggle` | bool | `false` | Render a sun/moon button in the footer + load the toggle script. | +| `schema` | bool | `true` | Emit schema.org `Person` JSON-LD in ``. Set `false` if you provide your own. | +| `jobTitle` | string | — | Optional `Person.jobTitle` field for JSON-LD. | +| `location` | string | — | Optional `Person.address` field for JSON-LD. | +| `email` | string | — | Optional `Person.email` field for JSON-LD. | | `footer` | bool | `true` | Show the footer. | | `footerText` | string (HTML) | `© {year} {name}` | Override footer text. HTML allowed. | | `links` | array | — | Bio links. See below. | @@ -103,6 +110,19 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "404"] | `url` | string | yes | Link target. `mailto:` and `tel:` are rendered without `target=_blank`. | | `icon` | string | no | Icon name from the available set (see below). Unknown names render a generic external-link glyph. | +## Color themes + +Four built-in palettes, each with light + dark variants. Set `colorTheme` in `[params]`: + +| Name | Vibe | Accent | +|------|------|--------| +| `bonsai` *(default)* | washi paper + vermilion seal | `#8b3a2b` | +| `sakura` | cherry blossom pink | `#d4456a` | +| `sumi` | monochrome ink | `#1a1a1a` | +| `koi` | orange + cream | `#c8521e` | + +Live preview: **[tiennm99.github.io/bonsai/themes/](https://tiennm99.github.io/bonsai/themes/)**. + ## Available Icons
diff --git a/themes/bonsai/exampleSite/hugo.toml b/themes/bonsai/exampleSite/hugo.toml index 754287f..3858409 100644 --- a/themes/bonsai/exampleSite/hugo.toml +++ b/themes/bonsai/exampleSite/hugo.toml @@ -11,7 +11,9 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "404"] tagline = "Software engineer · tending small things with care" bio = "Building tools, writing code, growing a quiet corner of the internet." avatar = "/images/avatar.svg" + colorTheme = "sakura" # try "bonsai" (default), "sakura", "sumi", "koi" themeToggle = true + jobTitle = "Software Engineer" footerText = "© 2026 · made with bonsai" [[params.links]]