config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package config loads and validates kwelea.toml configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	DocsDir   string `toml:"docs_dir"`
	OutputDir string `toml:"output_dir"`
}

BuildConfig controls where kwelea reads and writes files.

type Config

type Config struct {
	Site  SiteConfig  `toml:"site"`
	Build BuildConfig `toml:"build"`
	Serve ServeConfig `toml:"serve"`
	Theme ThemeConfig `toml:"theme"`
	Nav   []NavEntry  `toml:"nav"`
}

Config is the top-level configuration loaded from kwelea.toml.

func Load

func Load(path string) (*Config, error)

Load reads kwelea.toml from path, applies sensible defaults for any fields not present in the file, and returns the validated config.

type NavEntry struct {
	Section string   `toml:"section"`
	Pages   []string `toml:"pages"`
}

NavEntry is a manually-ordered navigation section defined in kwelea.toml. When no [[nav]] sections exist the walker builds the nav automatically from the docs/ directory structure.

type ServeConfig

type ServeConfig struct {
	Port        int  `toml:"port"`
	OpenBrowser bool `toml:"open_browser"`
}

ServeConfig controls the development server.

type SiteConfig

type SiteConfig struct {
	Title       string `toml:"title"`
	Version     string `toml:"version"`
	BaseURL     string `toml:"base_url"`
	Repo        string `toml:"repo"`
	ExtraHead   string `toml:"extra_head"`   // injected verbatim into <head> before </head>
	ExtraFooter string `toml:"extra_footer"` // injected verbatim into <footer> after attribution
}

SiteConfig holds site-level metadata shown in every page.

type ThemeConfig

type ThemeConfig struct {
	LightCodeTheme string `toml:"light_code_theme"`
	DarkCodeTheme  string `toml:"dark_code_theme"`
}

ThemeConfig controls syntax highlighting colour schemes.

Jump to

Keyboard shortcuts

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