render

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package render turns cached items into the static site.

One renderer pass (RenderAll) produces every configured river page, the unlinked firehose.html health page, and the assets. Output is deterministic for a given cache state — absolute timestamps in markup (river.js humanizes at VIEW time), stable ordering, content-derived item anchors that survive cache rebuilds — and every file is written atomically (temp+rename, world-readable 0644/0755 by design: the output is public web content served by a different user).

Presentation follows the one-voice rules: excerpts prefer a feed-provided summary, truncate the parsed tree (never a serialized string) and re-sanitize, and drop code blocks; theme resolution is user toggle over config default over OS preference, applied to tokens and the chroma palette alike.

Check dry-runs every template against synthetic fixtures so a broken template fails `firehose check`, not a live run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFallbackHealth

func WriteFallbackHealth(outputDir, msg, stack string) error

WriteFallbackHealth writes a minimal failure page using only Sprintf so it works even when the templating layer is what broke. Used by the top-level panic handler.

Types

type Renderer

type Renderer struct {

	// Now is injectable for tests.
	Now func() time.Time
	// contains filtered or unexported fields
}

Renderer renders all outputs for one run.

func New

New constructs a Renderer, parsing the embedded templates.

func (*Renderer) Check

func (r *Renderer) Check() error

Check dry-runs every template against a synthetic fixture so a broken template fails `firehose check`, not a live run.

func (*Renderer) RenderAll

func (r *Renderer) RenderAll(ctx context.Context) error

RenderAll renders every output (rivers + health) plus the shared assets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL