build

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is a struct for building a static site.

func NewBuilder

func NewBuilder(config *config.Config) *Builder

NewBuilder returns a new Builder.

func (Builder) GetDistPath added in v0.7.0

func (b Builder) GetDistPath() string

GetDistPath returns the dist directory path.

func (*Builder) ReloadConfig added in v0.7.0

func (b *Builder) ReloadConfig() error

ReloadConfig reloads the config file.

func (Builder) Run

func (b Builder) Run() error

Run builds the static site.

func (*Builder) SetBaseUrl added in v0.8.0

func (b *Builder) SetBaseUrl(baseURL string)

SetBaseUrl sets the base URL.

type FileData added in v0.8.0

type FileData struct {
	Path        string
	Content     string
	FrontMatter YamlFrontMatter
}

FileData is a struct for markdown file data.

type YamlFrontMatter added in v0.7.0

type YamlFrontMatter struct {
	Author      string   `yaml:"author"`
	Title       string   `yaml:"title"`
	PubDatetime string   `yaml:"pub_datetime"`
	PostSlug    string   `yaml:"post_slug"`
	Description string   `yaml:"description"`
	Tags        []string `yaml:"tags"`
	Emoji       string   `yaml:"emoji"`
	OgImage     string   `yaml:"og_image"`
}

func (*YamlFrontMatter) AsMap added in v0.7.0

func (y *YamlFrontMatter) AsMap() map[string]interface{}

func (*YamlFrontMatter) SaveTwemojiPng added in v0.8.0

func (y *YamlFrontMatter) SaveTwemojiPng(w io.Writer) error

func (*YamlFrontMatter) SaveTwemojiSvg added in v0.8.0

func (y *YamlFrontMatter) SaveTwemojiSvg(w io.Writer) error

Jump to

Keyboard shortcuts

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