config

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package config provides configuration-related types and functions.

Index

Constants

View Source
const (
	// Filename is the name of the config file without extension.
	Filename string = "verless"

	// ContentDir is the directory for Markdown content.
	ContentDir string = "content"

	// ThemesDir is the directory for verless themes.
	ThemesDir string = "themes"

	// TemplateDir is the directory for templates inside ThemesDir.
	TemplateDir string = "templates"

	// GeneratedDir is the directory which can be used by hook-commands
	// and which gets ignored by the serve command.
	// The directory can exist in each theme directory and in the StaticDir.
	GeneratedDir string = "generated"

	// CssDir is the directory for CSS files.
	CssDir string = "css"

	// JsDir is the directory for JavaScript files.
	JsDir string = "js"

	// DefaultTheme is the name of the default theme.
	DefaultTheme string = "default"

	// StaticDir is the directory for static files.
	StaticDir string = "static"

	// OutputDir is the default output directory.
	OutputDir string = "target"

	// IndexFile is the filename used as directory index.
	IndexFile string = "index.html"

	// PageTpl is the template file used for model.Page.
	PageTpl string = "page.html"

	// ListPageTpl is the template file used for model.ListPage.
	ListPageTpl string = "list-page.html"

	// ListPageID is the ID for custom list pages that overwrite
	// a auto-generated list page.
	ListPageID string = "index"
)

Variables

View Source
var (
	// GitTag is injected when building a new release.
	GitTag string = "UNDEFINED"
	// GitCommit stores the latest Git commit.
	GitCommit string = "UNKNOWN"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string
	Site    struct {
		Meta   model.Meta
		Nav    model.Nav
		Footer model.Footer
	}
	Plugins []string
	Theme   string
	Types   map[string]*model.Type
	Build   struct {
		Overwrite bool
		Before    []string
	}
}

Config represents the user configuration stored in verless.yml.

func FromFile

func FromFile(path, filename string) (Config, error)

FromFile looks for a configuration file and converts it to a Config.

Jump to

Keyboard shortcuts

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