diff --git a/README.md b/README.md index 7583cd0..4543dd5 100644 --- a/README.md +++ b/README.md @@ -276,15 +276,7 @@ The site-level CSS files (`reset.css`, `header.css`, `layout.css`) are optional ``` -Place these wherever you want the CMS to appear. The router toggles `hidden` between them on navigation. - -Optionally add a search form anywhere in the page: - -```html - -``` +Place these wherever you want the CMS to appear. The router toggles `hidden` between them on navigation. A search box and tag/year filter lists are optional and can go anywhere else in the page — see "Search, article list, and tag list as independent pieces" below. ### 3. Script — before `` @@ -301,6 +293,46 @@ Optionally add a search form anywhere in the page: > ``` > All internal fetches (articles, templates, marked.js) resolve relative to the module files via `import.meta.url` and work automatically — only the HTML tags need a path pointing at the right place. +### Search, article list, and tag list as independent pieces + +The mount points above don't have to sit next to each other, or even all be present — each is a +plain element the router looks up by `id`, wherever it happens to be in your page. This lets you +scatter search, the article list, and the tag list across a custom layout (search box in the site +header, tag list in a sidebar, articles in the main column) instead of stacking them the way the +demo does. + +- **Article list + single article — `#list-view` / `#article-view`.** These two are the only + required pair; the router toggles `hidden` between them and always needs both present somewhere + on the page. This pair is also where **search results** render — there's no separate results + container, so any page using the search box below still needs `#list-view` on it somewhere to + actually show what was searched for. +- **Search box — `#search-form` / `#search-input`.** Fully optional and independent; place it + anywhere (e.g. a site-wide header, not necessarily near the list). Submitting it navigates to + `#search/query`; matches render into `#list-view`. + ```html + + ``` +- **Tag list — `#tag-filters`.** Optional; put a container (a `