Documentation
¶
Index ¶
- Constants
- Variables
- func CompileTimeTemplate(datetime time.Time, template string) string
- func Generate() error
- func GetConfigPath() string
- func Ptr[T any](v T) *T
- func Write(conf Config) error
- type Config
- type GitHubConfig
- type HugoConfig
- type HugoContentConfig
- type HugoDirectoryConfig
- type HugoFilenameConfig
- type HugoImagesConfig
- type HugoURLConfig
- type OutputArticlesConfig
- type OutputConfig
- type OutputImagesConfig
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
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 GetConfigPath ¶
func GetConfigPath() string
Types ¶
type Config ¶
type Config struct {
GitHub *GitHubConfig `yaml:"github" mapstructure:"github"`
Output *OutputConfig `yaml:"output" mapstructure:"output"`
Hugo *HugoConfig `yaml:"hugo,omitempty" mapstructure:"hugo"`
}
func (*Config) WarnDeprecatedOptions ¶ added in v0.6.0
type GitHubConfig ¶
type GitHubConfig struct {
Username string `yaml:"username" mapstructure:"username"`
Repository string `yaml:"repository" mapstructure:"repository"`
Labels []string `yaml:"labels,omitempty" mapstructure:"labels"`
}
func NewGitHubConfig ¶ added in v0.6.0
func NewGitHubConfig() *GitHubConfig
func (*GitHubConfig) RepositoryURL ¶
func (c *GitHubConfig) RepositoryURL() string
type HugoConfig ¶
type HugoConfig struct {
Content *HugoContentConfig `yaml:"content,omitempty" mapstructure:"content"`
Images *HugoImagesConfig `yaml:"images,omitempty" mapstructure:"images"`
Bundle string `yaml:"bundle,omitempty" mapstructure:"bundle"`
Directory *HugoDirectoryConfig `yaml:"directory,omitempty" mapstructure:"directory"`
Filename *HugoFilenameConfig `yaml:"filename,omitempty" mapstructure:"filename"`
Url *HugoURLConfig `yaml:"url,omitempty" mapstructure:"url"`
}
type HugoContentConfig ¶ added in v1.0.0
type HugoDirectoryConfig ¶
type HugoFilenameConfig ¶ added in v0.6.0
type HugoImagesConfig ¶ added in v1.0.0
type HugoURLConfig ¶
type OutputArticlesConfig ¶ added in v1.0.0
type OutputArticlesConfig struct {
Directory string `yaml:"directory" mapstructure:"directory"`
Filename string `yaml:"filename" mapstructure:"filename"`
}
func NewOutputArticlesConfig ¶ added in v1.0.0
func NewOutputArticlesConfig() *OutputArticlesConfig
type OutputConfig ¶ added in v1.0.0
type OutputConfig struct {
Articles *OutputArticlesConfig `yaml:"articles" mapstructure:"articles"`
Images *OutputImagesConfig `yaml:"images" mapstructure:"images"`
}
func NewOutputConfig ¶ added in v1.0.0
func NewOutputConfig() *OutputConfig
type OutputImagesConfig ¶ added in v1.0.0
type OutputImagesConfig struct {
Directory string `yaml:"directory" mapstructure:"directory"`
Filename string `yaml:"filename" mapstructure:"filename"`
BaseURL *string `yaml:"url" mapstructure:"url"`
}
func NewOutputImagesConfig ¶ added in v1.0.0
func NewOutputImagesConfig() *OutputImagesConfig
func (*OutputImagesConfig) URL ¶ added in v1.0.0
func (c *OutputImagesConfig) URL() string
Click to show internal directories.
Click to hide internal directories.