config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: MIT Imports: 6 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

This section is empty.

Functions

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.

type GitHubConfig

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

func (*GitHubConfig) RepositoryURL

func (c *GitHubConfig) RepositoryURL() string

type HugoConfig

type HugoConfig struct {
	Bundle    string               `yaml:"bundle"`
	Directory *HugoDirectoryConfig `yaml:"directory"`
	Url       *HugoURLConfig       `yaml:"url"`
}

func (*HugoConfig) IsValidBundleType

func (c *HugoConfig) IsValidBundleType() bool

type HugoDirectoryConfig

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

type HugoURLConfig

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

Jump to

Keyboard shortcuts

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