config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package config loads obsite.yaml, applies caller-provided overrides, normalizes defaults, and resolves configuration-relative paths for downstream packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeSiteConfig

func NormalizeSiteConfig(cfg model.SiteConfig) (model.SiteConfig, error)

NormalizeSiteConfig applies the documented shared product defaults to a caller-provided site config, then validates and normalizes it.

Callers that already resolved explicit policy booleans through config loading should use ValidateLoadedSiteConfig to avoid re-defaulting false values for defaultPublish and rss.enabled.

func ValidateLoadedSiteConfig

func ValidateLoadedSiteConfig(cfg model.SiteConfig) (model.SiteConfig, error)

ValidateLoadedSiteConfig validates and normalizes a config that already has loader or caller-resolved boolean policy. Unlike NormalizeSiteConfig, it preserves explicit false values for defaultPublish and rss.enabled.

Types

type LoadedSiteConfig

type LoadedSiteConfig struct {
	Config model.SiteConfig
}

LoadedSiteConfig carries the normalized site config after config-file and load-path defaults have been resolved.

func LoadForBuild

func LoadForBuild(path string, overrides Overrides) (LoadedSiteConfig, error)

LoadForBuild reads obsite.yaml and returns the normalized site config plus build-only policy derived during loading.

type Overrides

type Overrides struct {
	Title          string
	BaseURL        string
	Author         string
	Description    string
	Language       string
	DefaultImg     string
	DefaultPublish *bool
	Theme          string
	VaultPath      string
}

Overrides carries caller-provided values. Empty strings and nil booleans mean the field was not provided.

Jump to

Keyboard shortcuts

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