configutil

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValidConfigFileExtensions = []string{"toml", "yaml", "yml", "json"}
)

Functions

func FromConfigString

func FromConfigString(config, configType string, data any) error

FromConfigString creates a config from the given YAML, JSON or TOML config. This is useful in tests.

func FromFile

func FromFile(fs afero.Fs, filename string, data any) error

FromFile loads the configuration from the given filename.

func GetFileExtension

func GetFileExtension(filename string) string

GetFileExtension return the extension of specfied filename

func IsValidConfigFilename

func IsValidConfigFilename(filename string) bool

IsValidConfigFilename returns whether filename is one of the supported config formats in Hugo.

Types

This section is empty.

Jump to

Keyboard shortcuts

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