Avatar Ilya Mateyko

go.astrophena.name/gen Module

GitHub repository | Commit (3e297b6)

An another static site generator.

This package is unmaintained.

package site

import "go.astrophena.name/gen/site"

Package site implements site building.

Index

Constants

const TemplateExt = ".tmpl"

TemplateExt is a template file extension.

Variables

var SupportedFormats = []string{".html", ".md"}

SupportedFormats contains supported page formats.

Types

type Page

type Page struct {
	URI         string            `yaml:"uri"`
	Content     string            `yaml:"-"`
	Title       string            `yaml:"title"`
	Description string            `yaml:"description"`
	MetaTags    map[string]string `yaml:"meta_tags"`
	Template    string            `yaml:"template"`
	// contains filtered or unexported fields
}

Page represents a site page.

func (*Page) Build

func (p *Page) Build() error

Build builds a site page to dst.

type Site

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

Site represents a site.

func New

func New(src, dst string, quiet, minify bool) (*Site, error)

New returns a new site.

func (*Site) Build

func (s *Site) Build() error

Build builds the site.

func (*Site) Clean

func (s *Site) Clean() (err error)

Clean removes all generated files.

func (*Site) Serve

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

Serve starts local HTTP server, serving the site.