config

package
v0.0.0-...-40d8c5d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFile = "gwconfig.yaml"
View Source
const HelpersDir = "tpl"
View Source
const PublicDir = "public"
View Source
const SourceDir = "source"
View Source
const TemplateExt = ".html"
View Source
const ThemesDir = "themes"
View Source
const UploadsDir = "uploads"
View Source
const Version = "1"

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexConfig

type IndexConfig struct {
	Stopwords        []string
	MinKeywordLength int
}
type MenuConfig struct {
	Items      []*MenuItem
	AutoPrefix bool `default:"true"`
}
type MenuItem struct {
	Target   string `default:"_self"`
	Title    string
	Href     string
	Children []*MenuItem
}

type PostConfig

type PostConfig struct {
	Title       string
	Blurb       string
	Tags        []string
	SkipIndex   bool `yaml:"skip_index"`
	SkipPublish bool `yaml:"skip_publish"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

PostConfig contains configuration information for a given post.

type SearchConfig

type SearchConfig struct {
	// MinKeywordLength is the minimum length of a keyword to be indexed.
	MinKeywordLength int      `yaml:"min_keyword_length" default:"3"`
	StopWords        []string `yaml:"stop_words"`
}

type SiteConfig

type SiteConfig struct {
	TimeFormat string `default:"2006-01-02 15:04:05"`
	Title      string
	Theme      ThemeConfig
	Copyright  string
	ConfigPath string // path to config yaml
	Homepage   string
	Index      IndexConfig
	PublicDir  string `yaml:"public_directory"`
	RootDir    string
	SourceDir  string
	// ThemeDir   string `yaml:"theme_directory,ignore"`
	Language     string       `default:"en"`
	Prefix       string       `yaml:"uri_prefix"`
	Search       SearchConfig `yaml:"search"`
	Version      string
	PostsPerPage int        `default:"2"`
	Menu         MenuConfig `yaml:"menu"`
	// contains filtered or unexported fields
}

func SiteFromConfig

func SiteFromConfig(files fsys.FileSystem) (*SiteConfig, error)

func (SiteConfig) ThemeDir

func (s SiteConfig) ThemeDir() string

func (*SiteConfig) UpdateMenuPrefixes

func (s *SiteConfig) UpdateMenuPrefixes(item *MenuItem)

UpdateMenuPrefixes recursively adds the site prefix to the menu items.

type ThemeAuthor

type ThemeAuthor struct {
	Name    string
	Email   string
	Website string
}

type ThemeConfig

type ThemeConfig struct {
	Path string
	Args map[string]any
}

type ThemeInfo

type ThemeInfo struct {
	Name        string
	Description string
	Author      ThemeAuthor
}

Jump to

Keyboard shortcuts

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