lib

package
v0.0.0-...-0748796 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileTemplate

func CompileTemplate(name string, raw []byte) ([]byte, error)

CompileTemplate compiles an HTML template

func Contains

func Contains(slice []string, str string) bool

Contains checks if a slice contains a string

func Handle

func Handle(err error)

Handle handles errors

func HasExt

func HasExt(str, ext string) bool

HasExt gets and validates a string's file extension

func MinifyHTML

func MinifyHTML(content []byte) ([]byte, error)

MinifyHTML runs tdedwolff/minify on a byte array consisting of HTML content

func MoveAssets

func MoveAssets(baseDir, outputDir string) (err error)

MoveAssets loads all asset files from directory and moves them into the `outputDir`.

Types

type Document

type Document struct {
	FileInfo os.FileInfo
	Content  []byte
	Layout   []byte
	FullPath string
}

Document is a Scarecrow document file

func (*Document) Compile

func (d *Document) Compile(dir, output string) (err error)

Compile turns a markdown document into a fully-formed HTML file using a layout

Jump to

Keyboard shortcuts

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