Documentation
¶
Overview ¶
Package generator implements the static site generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAuthorUnset = fmt.Errorf("author is unset") ErrContentDirUnset = fmt.Errorf("content dir is unset") ErrOutputDirUnset = fmt.Errorf("output dir is unset") )
View Source
var ErrEmptyName = fmt.Errorf("name must not be empty")
Functions ¶
func DefaultTemplateFS ¶
Types ¶
type Config ¶
type Config struct {
// Author is the websites' author (required).
Author string `json:"author"`
// BaseURL is the base URL that is used when generating absolute/canoncical URLs.
BaseURL string `json:"base_url"`
// ContentDir is the path of a directory that contains the websites content (required).
ContentDir string `json:"content_dir"`
// StaticDir is the path of a directory that contains static files to include in the generated website.
StaticDir string `json:"static_dir"`
// OutputDir is the path of a directory where the generated website will be stored into.
OutputDir string `json:"output_dir"`
// TemplatesDir is the path of a directory that contains a set of custom templates used to render the website.
TemplatesDir string `json:"templates_dir"`
// EnableUnsafeHTML allow embedding raw HTML snippets into markdown.
EnableUnsafeHTML bool `json:"unsafe_html"`
}
Config contains generator configuration values.
func ParseConfigFile ¶
ParseConfigFile instantiates a configuration from the given file.
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
FileStorage persists to a local file system.
func NewFileStorage ¶
func NewFileStorage(baseDir string) *FileStorage
NewFileStorage returns an initialized FileStorage.
Click to show internal directories.
Click to hide internal directories.