page

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: MIT Imports: 14 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 Page

type Page struct {
	URI         string
	Title       string
	Description string
	MetaTags    map[string]string
	Ext         string

	Body string

	CSS string
	// 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