web

package module
v0.0.0-...-cd37095 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 12 Imported by: 0

README

web

Package web is a simple, minimal, yet flexible static website generator.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset

func Asset(ctx context.Context, name string) string

func Main

func Main(configurer Configurer)

Types

type ConfigureFunc

type ConfigureFunc func(ctx context.Context, s *Site) error

func (ConfigureFunc) Configure

func (cf ConfigureFunc) Configure(ctx context.Context, s *Site) error

type Configurer

type Configurer interface {
	Configure(ctx context.Context, s *Site) error
}

type RenderFunc

type RenderFunc func(ctx context.Context, w io.Writer) error

func (RenderFunc) Render

func (rf RenderFunc) Render(ctx context.Context, w io.Writer) error

type Renderer

type Renderer interface {
	Render(ctx context.Context, w io.Writer) error
}

type Site

type Site struct {
	OutputDir string
	PublicDir string
	AssetsDir string
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, initialConfigurer Configurer) (*Site, error)

func SiteFromContext

func SiteFromContext(ctx context.Context) *Site

func (*Site) Asset

func (s *Site) Asset(name string) string

func (*Site) Build

func (s *Site) Build(ctx context.Context) error

func (*Site) Configure

func (s *Site) Configure(configurer Configurer)

func (*Site) ConfigureFunc

func (s *Site) ConfigureFunc(configurer func(ctx context.Context, s *Site) error)

func (*Site) Render

func (s *Site) Render(path string, renderer Renderer)

func (*Site) RenderFunc

func (s *Site) RenderFunc(path string, renderer func(ctx context.Context, w io.Writer) error)

func (*Site) Run

func (s *Site) Run(command string)

func (*Site) Serve

func (s *Site) Serve(addr string) error

Jump to

Keyboard shortcuts

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