page

package
v0.0.0-...-af76324 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 10 Imported by: 5

Documentation

Overview

Copyright (C) 2024 early (LGPL)

Copyright (C) 2024 early (LGPL)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config func(*Page)

func Funcs

func Funcs(funcs template.FuncMap) Config

func Includes

func Includes(includes ...compile.Source) Config

func Name

func Name(name string) Config

func OnLoad

func OnLoad(f render.OnLoadFunc) Config

func Pretty

func Pretty(indent string) Config

func Source

func Source(source string) Config

type Page

type Page struct {
	// contains filtered or unexported fields
}

func New

func New(name string, source string, optional ...func(*Page)) *Page

func Static

func Static(source string) *Page

Static returns a new Page that is just the passed source file, with no additional options/parts/etc.

func (*Page) Error

func (p *Page) Error() error

func (*Page) FileDependencies

func (p *Page) FileDependencies() []string

FileDependencies returns a list of absolute paths to files that are used in this page and its dependencies.

func (*Page) IncludeTagName

func (p *Page) IncludeTagName() bool

Pages are never included as a child, so this is always false.

func (*Page) Includes

func (p *Page) Includes() []compile.Source

func (*Page) Name

func (p *Page) Name() string

func (*Page) OnLoad

func (p *Page) OnLoad() render.OnLoadFunc

func (*Page) Raw

func (p *Page) Raw() string

func (*Page) ServeHTTP

func (p *Page) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Page) Source

func (p *Page) Source() include.Opener

func (*Page) TemplateFuncs

func (p *Page) TemplateFuncs() template.FuncMap

func (*Page) With

func (p *Page) With(optional ...func(*Page)) *Page

With returns a shallow copy of p with all of optional applied to it.

type RootData

type RootData struct {
	SetDot func(value any) error

	Data render.Data
}

Jump to

Keyboard shortcuts

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