page

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package page implements page parsing and generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Minify

func Minify(mimetype, src string) (string, error)

Minify minifies file src with the type mimetype, returning an error otherwise.

func ParseTemplates

func ParseTemplates(tpls []string) error

ParseTemplates parses templates tpls into template tpl, returning an error otherwise.

Types

type Frontmatter added in v0.2.3

type Frontmatter struct {
	URI         string            `yaml:"uri"`
	Title       string            `yaml:"title"`
	Description string            `yaml:"description"`
	MetaTags    map[string]string `yaml:"meta_tags"`
	Template    string            `yaml:"template"`
}

Frontmatter represents a page frontmatter.

type Page

type Page struct {
	Ext         string
	Body        string
	CSS         string
	Frontmatter *Frontmatter
	// contains filtered or unexported fields
}

Page represents a parsed page.

func ParseFile

func ParseFile(src string, css string) (*Page, error)

ParseFile parses page source file and returns Page or an error.

func (*Page) Generate

func (p *Page) Generate(dst string) (err error)

Generate generates HTML from a parsed page and writes it to dst, returning an error otherwise.

Jump to

Keyboard shortcuts

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