publicsite

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package publicsite renders published content as the built-in public site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) http.Handler

New returns the handler serving the built-in public site.

Types

type Config

type Config struct {
	// Content reads the published content the site shows.
	Content Reader
	// Locale answers the language the site chose for itself. Nil leaves the site in en-US.
	Locale SiteLocale
	// Types answers which content type an address belongs to.
	Types content.TypeReader
	// Title names the site in its chrome.
	Title string
	// Version is the application version the pages report.
	Version string
}

Config carries what the site renders with.

type Reader

type Reader interface {
	List(ctx context.Context, f content.Filter) ([]content.Content, int, error)
	PublishedByPath(ctx context.Context, path string) (content.Content, error)
	RelatedTo(ctx context.Context, target uuid.UUID, page, perPage int) ([]content.Content, int, error)
}

Reader reads the published content the site serves.

type Shell

type Shell struct {
	SiteTitle string
	Title     string
	Generator string
	Lang      string
	T         *i18n.Translator
}

Shell is the chrome every page carries.

type SiteLocale added in v0.6.0

type SiteLocale interface {
	Lookup(ctx context.Context, key string) (string, bool, error)
}

SiteLocale answers the language the site chose for itself.

Jump to

Keyboard shortcuts

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