zengarden

package module
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: BSD-3-Clause Imports: 18 Imported by: 0

README

Zen Garden

Super minimal and opinionated static site generator.

Documentation

Index

Constants

View Source
const (
	// DefaultConfigPath is the default path for the zen-garden config file.
	DefaultConfigPath = "_garden.toml"
)

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config) error

Run will build the site using the given configuration.

Types

type Categories

type Categories map[string]Posts

Categories is a map of category names to the posts of that category.

type Config

type Config struct {
	Source    string
	Target    string
	BaseURL   string
	Permalink string
	Paginate  int
	Style     string
	Excludes  []string

	Vars Context
}

Config is the configuration data for building the site.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration file at the given path, and adds any non-config variables to the Vars context.

type Context

type Context map[string]interface{}

Context is a simple dictionary for use in text/template files.

type Page

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

Page is a single non-post page not in the _posts directory.

type Pages

type Pages []*Page

Pages is a collection of non-post pages.

func (Pages) Len

func (p Pages) Len() int

func (Pages) Less

func (p Pages) Less(i, j int) bool

func (Pages) Swap

func (p Pages) Swap(i, j int)

type Paginator

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

Paginator handles paginating the posts into the correct pagination size, and generates the additional pagination pages.

type Post

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

Post is a single post from the _posts directory.

type Posts

type Posts []*Post

Posts is a collection of posts.

func (Posts) Len

func (p Posts) Len() int

func (Posts) Less

func (p Posts) Less(i, j int) bool

func (Posts) Swap

func (p Posts) Swap(i, j int)

type Renderer

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

Renderer is a custom blackfriday HTML renderer that uses the chroma library to highlight code in fenced code blocks.

func (*Renderer) RenderFooter

func (r *Renderer) RenderFooter(w io.Writer, ast *blackfriday.Node)

RenderFooter satisfies the Renderer interface

func (*Renderer) RenderHeader

func (r *Renderer) RenderHeader(w io.Writer, ast *blackfriday.Node)

RenderHeader satisfies the Renderer interface

func (*Renderer) RenderNode

func (r *Renderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus

RenderNode satisfies the Renderer interface

func (*Renderer) RenderWithChroma

func (r *Renderer) RenderWithChroma(w io.Writer, text []byte, data blackfriday.CodeBlockData) error

RenderWithChroma renders the given text to the w io.Writer

type Site

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

Site is the site being built.

Directories

Path Synopsis
cmd
zg command

Jump to

Keyboard shortcuts

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