config

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GenerateFile = "generate.yaml"

GenerateFile the file name of the generator config

View Source
const (
	// SectionFileName name of the section file
	SectionFileName = "section.yaml"
)
View Source
const SiteFile = "siteconfig.yaml"

SiteFile the default filename of the site config file

View Source
const (
	// WssgFolder folder name for the configuration
	WssgFolder = ".wssg"
)

Variables

View Source
var (
	// PageDefault the page default config
	PageDefault = Page{
		Title:     "{{.name}}",
		Name:      "{{.name}}",
		Processor: processors.DefaultProcessor,
	}
)
View Source
var SectionDefault = Section{
	Name:      "{{.name}}",
	Title:     "{{.name}}",
	Processor: processors.DefaultProcessor,
}

SectionDefault the default configuration of a section, used for creating a new one

View Source
var SiteDefault = Site{
	BaseURL:     "example.com",
	Title:       "example",
	Description: "a short description of this site",
	Keywords:    "tutorial basic static website",
	Language:    "en",
	UserProperties: objx.Map{
		"font": "Tahoma, Verdana, sans-serif",
		"webcontact": map[string]string{
			"url":   "mailto:info@example.com",
			"title": "info@example.com",
		},
		"socialmedia": map[string]any{
			"facebook": map[string]string{
				"title": "FB",
				"url":   "https://www.facebook.com/wilfried.klaas/",
			},
			"youtube": map[string]string{
				"title": "YT",
				"url":   "https://www.youtube.com/channel/UCg5ZpZJGuLgz4maETfUc9EA",
			},
		},
		"cookiebanner": map[string]any{
			"enabled": false,
			"text":    "",
		},
	},
}

SiteDefault the default of the site configuration

Functions

This section is empty.

Types

type Generate

type Generate struct {
	// Output where to output the generated site files
	Output string `yaml:"output"`
	// Processors conect mime types with processors
	ProcMime map[string]string `yaml:"procmime"`
	// Autoreload script
	Autoreload string `yaml:"autoreload"`
	// force forces to create everything newly
	Force bool `yaml:"force"`
}

Generate the configuration for the generator

var (
	// GenDefault the default generator config
	GenDefault = Generate{
		Output: fmt.Sprintf("./%s/output", WssgFolder),
		ProcMime: map[string]string{
			"text/html":     "plain",
			"text/markdown": "markdown",
			"text/plain":    "plain",
		},
		Autoreload: "",
	}
	// GenConfig the actual generator config
	GenConfig Generate
)

func LoadGenConfig

func LoadGenConfig(rootFolder string) Generate

LoadGenConfig loading the generator config from the site

type Page

type Page struct {
	Title     string `yaml:"title"`
	Name      string `yaml:"name"`
	Processor string `yaml:"processor"`
}

Page the configuration of a single page, used by frontmatter

func (Page) MSA added in v0.1.15

func (p Page) MSA() (output objx.Map)

MSA converting the page sturct into a general

type Section

type Section struct {
	Name           string `yaml:"name"`
	Title          string `yaml:"title"`
	Processor      string `yaml:"processor"`
	Order          int    `yaml:"order"`
	URLPath        string
	UserProperties objx.Map
}

Section the configuration of a section

func G2Section added in v0.1.7

func G2Section(g objx.Map) Section

G2Section convert a general struct to a section

func (Section) MSA added in v0.1.15

func (s Section) MSA() objx.Map

MSA convert this section to general

type Site

type Site struct {
	BaseURL        string `yaml:"baseurl"`
	Title          string `yaml:"title"`
	Description    string `yaml:"description"`
	Keywords       string `yaml:"keywords"`
	Language       string `yaml:"language"`
	UserProperties objx.Map
}

Site the configuration struct of the site

var (
	// SiteConfig this is the actual main configuration for this site
	SiteConfig Site
)

func LoadSite

func LoadSite(rootFolder string) Site

LoadSite loading the site config

func (*Site) MSA added in v0.1.15

func (s *Site) MSA() objx.Map

MSA converting this site config into a general map

type Version added in v0.1.5

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

Version the version information

func NewVersion added in v0.1.5

func NewVersion() *Version

NewVersion creating a new version

func (*Version) Commit added in v0.1.5

func (v *Version) Commit() string

Commit return in the commit information

func (*Version) Date added in v0.1.5

func (v *Version) Date() string

Date return in the date information

func (*Version) Version added in v0.1.5

func (v *Version) Version() string

Version return in the version information

func (*Version) WithCommit added in v0.1.5

func (v *Version) WithCommit(commit string) *Version

WithCommit setting the commit information fluid

func (*Version) WithDate added in v0.1.5

func (v *Version) WithDate(date string) *Version

WithDate setting the date information fluid

func (*Version) WithVersion added in v0.1.5

func (v *Version) WithVersion(version string) *Version

WithVersion setting the version information fluid

Jump to

Keyboard shortcuts

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