config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 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"

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

	// AssetDir is the directory for assets.
	AssetDir string = "assets"

	// 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"

	// IndexPageTpl is the template file used for model.IndexPage.
	IndexPageTpl string = "index-page.html"
)

Variables

View Source
var (
	// Version is injected when building a new release.
	Version string = "UNDEFINED"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string
	Site    struct {
		Meta model.Meta
		Nav  struct {
			Items []struct {
				Label  string
				Target string
			}
			Overwrite bool
		}
		Footer struct {
			Items []struct {
				Label  string
				Target string
			}
			Overwrite bool
		}
	}
	Plugins []string
	Build   struct {
		Overwrite bool
	}
}

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.

func (Config) HasPlugin

func (c Config) HasPlugin(key string) bool

HasPlugin checks if the configuration has enabled a given plugin.

Jump to

Keyboard shortcuts

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