internal

package
v0.0.0-...-149d4c5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(filename string) error

func SaveConfig

func SaveConfig(config *BlogConfig, filename string) error

Types

type BlogConfig

type BlogConfig struct {
	// filesystem data
	Root   string `json:"root"`
	Output string `json:"output"`

	// author and site data
	Author   string `json:"Author"`
	Email    string `json:"Email"`
	Domain   string `json:"Domain"`
	Title    string `json:"Title"`
	SubTitle string `json:"SubTitle"`

	// meta data used within bloghead
	Blueprints map[string]string `json:"blueprints"`
	Articles   []string          `json:"articles"`
}

Blog config corresponds to the configuration file used to initialize the bh instance. This file also contains saved state for the site, such as blueprint file paths sss

func ReadConfig

func ReadConfig(filename string) (*BlogConfig, error)

type BlogHead

type BlogHead struct {
	Root   string
	Output string
	// contains filtered or unexported fields
}

BlogHead keeps track of everything going on during the site's build process.

func FromEnv

func FromEnv() *BlogHead

func (*BlogHead) Add

func (bh *BlogHead) Add(typ, name, bp string) (err error)

Adds a new page of 'typ' at 'path'

func (*BlogHead) Create

func (bh *BlogHead) Create(typ, name string) (err error)

Create a new template at the specified location This will create a new 'blueprint' file which will be copied when a new page is added using the 'add' command.

func (*BlogHead) Save

func (bh *BlogHead) Save() error

Saves the current state of the site

func (*BlogHead) SetMetaValue

func (bh *BlogHead) SetMetaValue(key, value string) error

Update the metadata value for this bloghead instance and save configuration. If the key is not found, an error will occur

func (*BlogHead) Start

func (bh *BlogHead) Start() error

Start compiling pages found in the root directory Ignores the directory named '.templates'

func (*BlogHead) Watch

func (bh *BlogHead) Watch() error

Watch initializes the filesystem watcher for all files found in the root directory, including the '.templates' directory. On a file change, the file is rebuilt along with all files which use the changed template. The site is created before the watcher is initialized

Jump to

Keyboard shortcuts

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