cms/blog · v2.0.2
Blog Theme Guide
Quick reference for running a blog, news, or announcements site on Baklib with the
blog template. Static URL: /s/about.
1. Overview
Template name
blog (themes/cms/blog) — Baklib CMS scope, version
2.0.2. Stack: Tailwind CSS v4, daisyUI v5, Turbo + Stimulus, Lucide icons.
Purpose
- Publish time-ordered articles, release notes, and announcements.
- Let visitors browse by tags, search, and read rich article pages.
- Give editors two home layouts (card grid vs. compact list) without changing the article template.
Highlights
- Hero-led home with tag toolbar and publish-date sorting on the card layout.
- Admin-driven theme colors mapped at runtime to daisyUI semantic tokens.
- Sticky site header plus article breadcrumb bar with page tools (copy link, etc.).
Storefront templates
index/index.list— home (card grid or list)page— article with cover, body, child cards, optional feedbacktag,search— tag archive and site search
2. For content managers
- Create a site — In the template marketplace, select the blog template to start a new CMS site.
-
Configure the site — In admin: site language, theme colors (recommended palettes in theme settings), home page dynamic fields (title, description, hero image), custom domain, Feedback form toggle, and access control as needed. Wire header/footer menus via
header_menu_html/footer_menu_htmlin theme settings. -
Publish content — Add child pages under home, choose the Page template, fill dynamic fields (title, cover, body, tags), then publish and preview. Switch the home page template between
index(cards) andindex.list(list + search) anytime.
Site tags are created in admin (not in theme settings). Attach them on articles via the page template tag_picker field. Seed sample menus live in seeds/001_site.yml.
3. For developers
Baklib CMS templates
Theme development conventions (Liquid layout, objects, static routes, seeds) are documented in the
baklib-theme-dev agent skill — path /baklib-theme-dev in the Baklib repo
(not a public URL). Platform API and Liquid reference:
dev.baklib.cn.
File tree (concise)
cms/blog/
├── config/settings_schema.json
├── layout/theme.liquid, error.liquid
├── templates/
│ ├── index.liquid # home — card grid
│ ├── index.list.liquid # home — list + search
│ ├── page.liquid, tag.liquid, search.liquid
│ └── feedback_*.liquid
├── snippets/
│ ├── _index_hero.liquid
│ ├── _tags_toolbar.liquid, _card_grid.liquid, _list.liquid
│ ├── _breadcrumb.liquid, _header.liquid, _footer.liquid
│ ├── _theme_runtime_colors.liquid, _icon.liquid
│ └── …
├── statics/about.liquid, brand.liquid, tags.liquid, recent.liquid
├── seeds/001_site.yml, 002_pages.yml
├── src/ → built to assets/ (npm run build)
└── locales/*.json
Key implementation spots
_index_hero— home hero from page variablestitle,description,hero_image_url; omitted when all empty.indexvsindex.list— card grid usestags_toolbar+pages_in_listby publish date; list home uses inline search, tag tabs, andchildren_in_list._tags_toolbar— tag pills and sort query on card home and tag template (?sort=published_desc|published_asc)._breadcrumb+_header— fixed site header; second sticky bar on articles with trail + page tools (Stimulus)._theme_runtime_colors— maps--theme-color-*to daisyUI--color-*; sets--header-height._card_grid— shared card for home, tag archive, and child-page grids.seeds/— demo language, menus (including/s/about), hero defaults, sample articles.statics/brand.liquid— visual token gallery at/s/brand(standalone layout, brand defaults inlined).
Pagination example (escaped): {% paginate_tag pages_in_list, per: 9 %}.
After editing src/, run npm run build before committing built assets.
4. Resources
- Brand guidelines —
/s/brand· colors, radius, components for this theme. - dev.baklib.cn — CMS templates, Liquid objects, API.
- help.baklib.cn/themes — theme help center.
- Repo:
README.md(English),README.zh-CN.md(maintainer notes).
Other static routes: /s/tags, /s/recent.