build

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

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

Go to latest
Published: Oct 16, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDraftFile = errors.New("file is draft")

ErrDraftFile is error to notify that file is a draft.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnableCache  bool
	BuildDraft   bool
	MinifyOutput bool
}

Config is configuration for Worker.

type Worker

type Worker struct {
	RootDir    string
	ContentDir string
	// contains filtered or unexported fields
}

Worker is the one that build markdown into HTML file.

func NewWorker

func NewWorker(rootDir string, cfg Config) (wk Worker, err error)

NewWorker returns a new worker. Requires root dir which point to directory where site lives.

func (*Worker) Build

func (wk *Worker) Build(urlPath string, w io.Writer) ([]string, error)

Build builds HTML for specified URL path. There are two possible URL path combination : 1. It's pointed directly to content, e.g. /blog/awesome or /blog/awesome/1 2. It's URL for tag list, e.g. /blog/awesome/#cat or /blog/awesome/#cat/2

Jump to

Keyboard shortcuts

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