Static blog site generator in one Go binary: Markdown in, self-contained semantic HTML out. No JavaScript, no database, minimal deps.

TOC: toc: disclosure renders the TOC as a native <details> #30

Merged janantos.tngl.sh
targeting main from toc-disclosure
Merged opened by and assigned to janantos.tngl.sh
targeting main from toc-disclosure

The toc frontmatter now takes two styles (frontmatter only, not config):

  • toc: true (default, unchanged): the ruled contents box, always visible
  • toc: disclosure: the same entries as a native
    /, collapsed until clicked — the browser toggles it, no JavaScript
  • toc: false/0/no/off stay off (backwards compatible); any other value is a hard error, like an unknown type

Post.TOCStyle carries the style; TOCFromHTML takes it as an argument and only changes the wrapper (nav+p.toc__title vs details+summary). The disclosure reuses the .toc ruled-box CSS; a small summary rule matches the title's weight. Post-page, unit and parse tests cover both styles and the error case; the showcase post documents and lists the new option. Default output is byte-identical to before.

Commits 0