Files
sukr/docs/content/features/sections.md
Timothy DeHerrera bdf8976378 docs: rewrite homepage and consolidate sections
Rewrite _index.md as explanation-only — remove inline Quick
Start, add Learn More links. Move section discovery explanation
from features/sections.md into content-organization.md. Slim
sections.md to reference-only with cross-reference.
2026-02-12 13:04:07 -07:00

45 lines
1.3 KiB
Markdown

---
title: Sections
description: Section types, frontmatter, and template dispatch reference
weight: 2
---
sukr discovers sections from your content directory structure. For an explanation of how sections work and how directories map to site structure, see [Content Organization](../content-organization.html).
## Section Types
The section type determines which template is used. It resolves in order:
1. **Frontmatter override**: `section_type: blog` in `_index.md`
2. **Directory name**: `content/blog/` → type `blog`
### Built-in Section Types
| Type | Behavior |
| ---------- | ------------------------------------------------------ |
| `blog` | Sorts by date (newest first), renders individual posts |
| `projects` | Sorts by weight, card-style listing |
| _(other)_ | Sorts by weight, uses default template |
## Section Frontmatter
In `_index.md`:
```yaml
---
title: My Blog
description: Thoughts and tutorials
section_type: blog # Optional, defaults to directory name
weight: 1 # Nav order
---
```
## Adding a New Section
1. Create directory: `content/recipes/`
2. Create index: `content/recipes/_index.md`
3. Add content: `content/recipes/pasta.md`
4. Optionally create template: `templates/section/recipes.html`
That's it. sukr handles the rest.