Commit Graph

8 Commits

Author SHA1 Message Date
Timothy DeHerrera
e7809e1ce2 feat: add 404 page and tag listing generation
Detect content/_404.md as special page (underscore
prefix convention), store in SiteManifest.page_404,
render to 404.html in output root.

Add collect_tags() grouping all tagged content into
BTreeMap for deterministic output. render_tag_page()
renders through tags/default.html template.

Add 5 tests. Test suite: 78 → 83, all passing.
2026-02-14 16:03:30 -07:00
Timothy DeHerrera
53463b3d8b feat: generate HTML redirects for aliases
Add generate_aliases(), write_aliases(), and
redirect_html() to main.rs. For each content item
with aliases in frontmatter, writes a minimal HTML
redirect stub with meta refresh and canonical link.

Alias paths are normalized: bare paths get
/index.html appended, .html extensions preserved.

Add 2 tests. Test suite: 76 → 78, all passing.
Phase 2 complete — all plan items checked off.
2026-02-14 07:24:57 -07:00
Timothy DeHerrera
7e692aacb4 feat: filter draft content from all output
Add draft filtering at discovery source functions:
collect_items(), discover_nav(), discover_pages().
Posts, feed, and sitemap inherit filtering
automatically via collect_items().

Items with frontmatter draft = true are excluded
from section listings, navigation, feed, and
sitemap. Default is false — no behavior change
for existing content.

Add 3 tests. Test suite: 73 → 76, all passing.
2026-02-14 07:20:47 -07:00
Timothy DeHerrera
0c9ecbfad6 feat: gate feed/sitemap generation on config
Wire config.feed.enabled and config.sitemap.enabled
into main.rs run() function. Both default to true,
so existing behavior is preserved.

Add 5 new tests: feed/sitemap config defaults,
independent disable, and ConfigContext nav structure
with base_url trailing-slash normalization.

Test suite: 69 → 73 tests, all passing.
Phase 1 complete — all plan items checked off.
2026-02-14 07:12:56 -07:00
Timothy DeHerrera
45448cc443 feat: normalize config context and template API
Add FeedConfig and SitemapConfig structs to config.rs
with enabled: bool (default true) for opt-out control.

Refactor ConfigContext: flat nested_nav bool replaced
with nested nav: NavContext { nested, toc } to mirror
site.toml [nav] table structure.

Remove standalone base_url template variable; use
config.base_url as single source of truth with
trailing-slash trimming in ConfigContext::from().

Add section template fallback: try section/<type>.html,
fall back to section/default.html for unknown types.

Delete section/features.html (duplicate of default.html)
and homepage.html (dead code, never referenced).

Update base.html for new variable names.
2026-02-14 07:09:05 -07:00
Timothy DeHerrera
46c00c7729 docs: migrate content files to TOML frontmatter
Migrate all 17 docs/content/ files from --- YAML to +++ TOML
frontmatter delimiters and key = value syntax.

Update 8 embedded frontmatter examples in 7 documentation pages
to match (configuration, content-organization, getting-started,
security, sections, sitemap, feeds, templates).

Update configuration.md frontmatter reference table: add draft
and aliases fields, correct date type from string to date.
2026-02-14 06:57:55 -07:00
Timothy DeHerrera
16fed12273 feat!: replace YAML frontmatter with TOML
Replace hand-rolled YAML parser (70 lines) with serde-backed
toml::from_str<Frontmatter> (6 lines). Frontmatter delimiter
changes from --- to +++ (Hugo TOML convention).

New Frontmatter fields:
- draft: bool (#[serde(default)]) for draft filtering
- aliases: Vec<String> (#[serde(default)]) for URL redirects

Date field upgraded from Option<String> to Option<NaiveDate>
with custom deserializer for TOML native dates. Parse, don't
validate: invalid dates now fail at deserialization time.

Add chrono dependency with serde feature. Update cascade in
sitemap.rs (NaiveDate→String at boundary), template_engine.rs
(FrontmatterContext gains draft/aliases), and all 14 tests.

BREAKING CHANGE: Content files must use +++ TOML frontmatter
instead of --- YAML frontmatter.
2026-02-14 06:50:35 -07:00
Timothy DeHerrera
021ffb6a78 docs(plan): add sukr 1.0 API stabilization plan
Three-phase plan to stabilize sukr's public API surfaces before 1.0:

- Phase 1: Replace hand-rolled YAML frontmatter with TOML (+++ delimiters,
  serde Deserialize), normalize template variable naming, add feed/sitemap
  config toggles, template section fallback, remove dead templates
- Phase 2: Draft filtering and alias redirect stub generation
- Phase 3: 404 page support and tag listing page generation

Key decisions: TOML frontmatter (eliminates fragile parser), config.nav
nesting to mirror site.toml structure, flat tags array, date validation
via chrono::NaiveDate.

Ref: .sketches/2026-02-13-api-stabilization.md
2026-02-14 06:24:56 -07:00