feat: derive sidebar from content
This commit is contained in:
@@ -6,7 +6,7 @@ weight = 12
|
||||
|
||||
The fast path is to change four things in `hugo.toml`: `baseURL`, `title`, `params.sidebarFooter`, and `params.homeFooter`.
|
||||
|
||||
Then adjust `menus.main`. The sidebar shape comes from the menu, so you do not need a special data file or extra config layer.
|
||||
Then adjust `title` and `weight` in your content files. The sidebar shape comes from the section tree, so you do not need a special data file or a menu block for each page.
|
||||
|
||||
If you want a different voice on the homepage, edit `content/_index.md`. If you want layout changes, start in `themes/starless/layouts/_default/baseof.html`.
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ weight = 13
|
||||
|
||||
The files that matter are not hard to find.
|
||||
|
||||
- `hugo.toml` sets the theme, site title, footer text, and sidebar menu.
|
||||
- `content/` holds the homepage and this short guide.
|
||||
- `hugo.toml` sets the theme, site title, and footer text.
|
||||
- `content/` holds the homepage and this short guide. Its section tree also drives the sidebar.
|
||||
- `themes/starless/layouts/_default/baseof.html` builds the page shell and the shared styling.
|
||||
- `themes/starless/layouts/partials/sidebar.html` renders the left rail.
|
||||
- `themes/starless/layouts/partials/menu-tree.html` renders the nested menu links.
|
||||
- `themes/starless/layouts/partials/menu-tree.html` renders the nested section and page links.
|
||||
- `themes/starless/layouts/_default/home.html`, `list.html`, and `single.html` handle the main content area.
|
||||
|
||||
If you are trying to understand the theme, read those files in that order. There is not much else hiding off to the side.
|
||||
|
||||
@@ -8,6 +8,6 @@ If you fork this repo, you already have the theme and the demo site in one place
|
||||
|
||||
If you want to drop Starless into another Hugo site, copy the `themes/starless/` folder into that project and set `theme = "starless"` in `hugo.toml`.
|
||||
|
||||
After that, add a small `menus.main` block so the sidebar has something to render. The current config in this repo is enough to copy and trim.
|
||||
After that, add an `_index.md` for each section you want listed and set `weight` in front matter to control order. The sidebar follows the `content/` tree automatically.
|
||||
|
||||
Run `hugo server` and edit from there. The theme is simple enough that most changes show up where you expect.
|
||||
|
||||
Reference in New Issue
Block a user