mirror of
https://github.com/tiennm99/bonsai.git
synced 2026-05-26 23:57:44 +00:00
f0d1e785f8
- README: add badges (build/license/Hugo), live-demo callouts, full configuration parameter table, expanded features list - CONTRIBUTING.md: dev setup, icon-add workflow, PR/style guidelines - CHANGELOG.md: Keep-a-Changelog format with v0.1.0 + v0.0.1 entries - theme.toml: point demosite at live GitHub Pages URL
2.3 KiB
2.3 KiB
Contributing to Bonsai
Thanks for your interest. Bonsai is intentionally small — every change should make it simpler, faster, or more useful, never bigger for its own sake.
Local development
git clone https://github.com/tiennm99/bonsai.git
cd bonsai/exampleSite
hugo server --themesDir ../.. --bind 0.0.0.0
Open http://localhost:1313/. Edits to layouts/, static/, data/, and assets/ hot-reload.
Hugo Extended ≥ 0.128 required. CI pins 0.154.0.
Adding an icon
The icon system is data-driven — adding one means three small edits.
- Vendor the SVG. Edit
scripts/sync-icons.sh:- For brand/social icons → add the slug to the
BRAND_SLUGSlist (sourced from Simple Icons). - For UI/utility icons → add the slug to the
UI_SLUGSlist (sourced from Lucide).
- For brand/social icons → add the slug to the
- Run the script to fetch and normalise:
./scripts/sync-icons.sh - Register the public name in
data/icons.yaml:newicon: { family: brand, slug: newicon } - Rebuild and verify the icon renders in the gallery:
cd exampleSite && hugo server --themesDir ../..→http://localhost:1313/icons/ - Add the new name to the appropriate table in
README.md.
Pull requests
- Branch from
main. Keep PRs focused — one concern per PR. - Conventional commit prefixes:
feat:,fix:,docs:,chore:,ci:,refactor:. - For visual changes, attach a before/after screenshot (the live demo URL helps reviewers).
- CI must be green (
buildworkflow runshugo --gc --minifyagainstexampleSite).
Style
- HTML & CSS: 2-space indent. Keep
partials/files under 30 lines where possible. - Hugo templates: prefer
{{- ... -}}to suppress whitespace; usepartialsfor reuse. - CSS: BEM-ish naming (
.bio__name,.link__icon); CSS custom properties for theming. - No build steps for end users — vendored assets only. If you reach for
npm install, reconsider.
Reporting issues
Include: Hugo version (hugo version), theme version/commit, minimal reproduction (a snippet of hugo.toml is usually enough), expected vs actual.
Philosophy
YAGNI · KISS · DRY. If a feature would be useful for some sites, it doesn't belong here unless it's useful for most link-in-bio sites. The strength of Bonsai is what it leaves out.