site

package
v0.0.0-...-8ffb5d3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Visit

func Visit(dir string, errOut io.Writer, fn func(*Resource) error) error

Types

type Image

type Image struct {
	Width  int
	Height int
	Src    string
}

func (*Image) SrcWidthHeight

func (img *Image) SrcWidthHeight() htemplate.HTMLAttr

type ImageSrcSet

type ImageSrcSet struct {
	Image
	SrcSet string
}

type Page

type Page struct {
	// Title is the page's title.
	Title string

	// Subtitle is the page's subtitle.
	Subtitle string

	// Created is the page creation time.
	Created time.Time

	// Updated is the time that the page was updated.
	Updated time.Time

	// Page path.
	Path string

	// Scratch data with page scope.
	Scratch *scratch.Scratch

	Content htemplate.HTML
}

Page represents the meta data for a page.

type ReadSeekCloser

type ReadSeekCloser interface {
	io.ReadSeeker
	io.Closer
}

type Resource

type Resource struct {
	// URI with leading slash and no trailing index file name.
	Path string

	// Modification time
	ModTime time.Time

	// Size in bytes
	Size int64

	// FilePath is path to resource on disk.
	FilePath string

	// Redirect requests to this URL.
	Redirect string

	// Data is the page data. If set, data overrides the resource data
	// stored on disk.
	Data []byte

	// For use by commands.
	UpdateReason string
}

Resource represents a resource on the site.

func (*Resource) Open

func (r *Resource) Open() (reader ReadSeekCloser, contentType string, err error)

Open opens an reader on the resource's data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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