templates

package
v0.0.0-...-a13b488 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Files fs.FS
View Source
var LiveReload = Script(Defer(), g.Raw(`
    new EventSource("/_/reload").onmessage = event => {
        console.log("got message", event)
        window.location.reload()
    };
`))

Functions

func Error

func Error(site SiteSettings, err http.Error) g.Node

func ExtendAttrs

func ExtendAttrs(base Attrs, attrs Attrs) g.Node

func FormattedDocument

func FormattedDocument(doc g.Node) g.NodeWriter

func Layout

func Layout(site SiteSettings, page PageSettings, children ...g.Node) g.NodeWriter

func MakeWriterTo

func MakeWriterTo(file fs.File) io.WriterTo
func MenuLink(item config.MenuItem) g.Node

Types

type Attrs

type Attrs map[string]string

type FileWriterTo

type FileWriterTo struct {
	File fs.File
}

func (FileWriterTo) WriteTo

func (f FileWriterTo) WriteTo(w io.Writer) (int64, error)

type PageSettings

type PageSettings struct {
	Title      string
	TitleAttrs Attrs
	BodyAttrs  Attrs
	HeadExtra  []g.Node
}

type SiteSettings

type SiteSettings struct {
	Title            string
	Language         string
	Timezone         config.Timezone
	Menu             []config.MenuItem
	InjectLiveReload bool
}

Jump to

Keyboard shortcuts

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