config

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFileDir is the directory of the configuration file.
	ConfigFileDir = "."

	// ConfigFileName is the name of the configuration file.
	ConfigFileName = "gic.config"

	// ConfigFileType is the type of the configuration file.
	ConfigFileType = "yaml"
)

Variables

View Source
var GitHubToken string

Functions

func CompileTimeTemplate added in v0.6.0

func CompileTimeTemplate(datetime time.Time, template string) string

compile compiles a template with the given datetime. %Y - Year with century as a decimal number. %m - Month as a decimal number [01,12]. %d - Day of the month as a decimal number [01,31]. %H - Hour (24-hour clock) as a decimal number [00,23]. %M - Minute as a decimal number [00,59]. %S - Second as a decimal number [00,59].

func Generate

func Generate()

Generate generates a configuration file.

func GetConfigPath

func GetConfigPath() string

Types

type Config

type Config struct {
	GitHub *GitHubConfig `yaml:"github"`
	Hugo   *HugoConfig   `yaml:"hugo"`
}

func Get

func Get() Config

Get returns a configuration. If the configuration is not loaded, it loads it.

func NewConfig added in v0.6.0

func NewConfig() *Config

func (*Config) WarnDeprecatedOptions added in v0.6.0

func (c *Config) WarnDeprecatedOptions() bool

type GitHubConfig

type GitHubConfig struct {
	Username   string `yaml:"username"`
	Repository string `yaml:"repository"`
}

func NewGitHubConfig added in v0.6.0

func NewGitHubConfig() *GitHubConfig

func (*GitHubConfig) RepositoryURL

func (c *GitHubConfig) RepositoryURL() string

type HugoConfig

type HugoConfig struct {
	Bundle    string               `yaml:"bundle,omitempty"`
	Directory *HugoDirectoryConfig `yaml:"directory"`
	Filename  *HugoFilenameConfig  `yaml:"filename"`
	Url       *HugoURLConfig       `yaml:"url"`
}

func NewHugoConfig added in v0.6.0

func NewHugoConfig() *HugoConfig

type HugoDirectoryConfig

type HugoDirectoryConfig struct {
	Articles string `yaml:"articles"`
	Images   string `yaml:"images"`
}

func NewHugoDirectoryConfig added in v0.6.0

func NewHugoDirectoryConfig() *HugoDirectoryConfig

type HugoFilenameConfig added in v0.6.0

type HugoFilenameConfig struct {
	Articles string `yaml:"articles"`
	Images   string `yaml:"images"`
}

func NewHugoFilenameConfig added in v0.6.0

func NewHugoFilenameConfig() *HugoFilenameConfig

type HugoURLConfig

type HugoURLConfig struct {
	AppendSlash bool   `yaml:"appendSlash,omitempty"`
	Images      string `yaml:"images"`
}

func NewHugoURLConfig added in v0.6.0

func NewHugoURLConfig() *HugoURLConfig

Jump to

Keyboard shortcuts

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