Documentation
¶
Index ¶
- func Serve(ctx *Context, listen string, fs fs.FS) error
- type Builder
- type Config
- func (conf *Config) GetSubSlice(key string) []*viper.Viper
- func (conf *Config) LoadFromFile(file string) error
- func (conf *Config) MergeFromDefaultConfig(force bool)
- func (conf *Config) MergeFromThemeConfig(theme fs.FS) error
- func (conf *Config) Reset(m map[string]any, force bool)
- func (conf *Config) SetDebug()
- func (conf *Config) SetMode(mode string)
- type Context
- type ContextOption
- type Error
- type LocaleContext
- func (ctx *LocaleContext) GetBaseURL() string
- func (ctx *LocaleContext) GetContentDir() string
- func (ctx *LocaleContext) GetFormatConfig(name string, keyName string) Result
- func (ctx *LocaleContext) GetLanguage() string
- func (ctx *LocaleContext) GetMarkupConfig(name string, keyName string) Result
- func (ctx *LocaleContext) GetOutputDir() string
- func (ctx *LocaleContext) GetPageConfig(dir string) map[string]any
- func (ctx *LocaleContext) GetPathSlug(path string) string
- func (ctx *LocaleContext) GetRelURL(path string) string
- func (ctx *LocaleContext) GetSectionConfig(dir string) map[string]any
- func (ctx *LocaleContext) GetSlug(name string) string
- func (ctx *LocaleContext) GetStaticDir() string
- func (ctx *LocaleContext) GetSummary(content string) string
- func (ctx *LocaleContext) GetTaxonomyConfig(name string, keyName string) Result
- func (ctx *LocaleContext) GetThemeDir() string
- func (ctx *LocaleContext) GetURL(path string) string
- type Logger
- type Result
- type Server
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
func DefaultConfig ¶
func DefaultConfig() *Config
func (*Config) LoadFromFile ¶
func (*Config) MergeFromDefaultConfig ¶
type Context ¶
type Context struct {
*LocaleContext
Logger Logger
ThemeFS fs.FS
OtherLanguages map[string]*LocaleContext
}
func NewContext ¶
func NewContext(conf *Config, opts ...ContextOption) (*Context, error)
func (*Context) For ¶
func (ctx *Context) For(lang string) *LocaleContext
func (*Context) GetAllLanguages ¶
func (*Context) GetDefaultLanguage ¶
func (*Context) VerifyLanguage ¶
type ContextOption ¶
type ContextOption func(*Context)
func WithLogger ¶
func WithLogger(log Logger) ContextOption
type LocaleContext ¶
type LocaleContext struct {
Config *Config
}
func (*LocaleContext) GetBaseURL ¶
func (ctx *LocaleContext) GetBaseURL() string
func (*LocaleContext) GetContentDir ¶
func (ctx *LocaleContext) GetContentDir() string
func (*LocaleContext) GetFormatConfig ¶
func (ctx *LocaleContext) GetFormatConfig(name string, keyName string) Result
func (*LocaleContext) GetLanguage ¶
func (ctx *LocaleContext) GetLanguage() string
func (*LocaleContext) GetMarkupConfig ¶ added in v0.1.6
func (ctx *LocaleContext) GetMarkupConfig(name string, keyName string) Result
func (*LocaleContext) GetOutputDir ¶
func (ctx *LocaleContext) GetOutputDir() string
func (*LocaleContext) GetPageConfig ¶
func (ctx *LocaleContext) GetPageConfig(dir string) map[string]any
func (*LocaleContext) GetPathSlug ¶
func (ctx *LocaleContext) GetPathSlug(path string) string
func (*LocaleContext) GetRelURL ¶
func (ctx *LocaleContext) GetRelURL(path string) string
func (*LocaleContext) GetSectionConfig ¶
func (ctx *LocaleContext) GetSectionConfig(dir string) map[string]any
func (*LocaleContext) GetSlug ¶
func (ctx *LocaleContext) GetSlug(name string) string
func (*LocaleContext) GetStaticDir ¶
func (ctx *LocaleContext) GetStaticDir() string
func (*LocaleContext) GetSummary ¶
func (ctx *LocaleContext) GetSummary(content string) string
func (*LocaleContext) GetTaxonomyConfig ¶
func (ctx *LocaleContext) GetTaxonomyConfig(name string, keyName string) Result
func (*LocaleContext) GetThemeDir ¶
func (ctx *LocaleContext) GetThemeDir() string
func (*LocaleContext) GetURL ¶
func (ctx *LocaleContext) GetURL(path string) string
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) StringSlice ¶
Click to show internal directories.
Click to hide internal directories.