Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocation ¶
Types ¶
type Collator ¶
func (*Collator) CompareStrings ¶
CompareStrings compares a and b. It returns -1 if a < b, 1 if a > b and 0 if a == b. Note that the Collator is not thread safe, so you may want to aquire a lock on it before calling this method.
type Language ¶
type Language struct { Lang string Weight int // for sort // If set per language, this tells Hugo that all content files without any // language indicator (e.g. my-page.en.md) is in this language. // This is usually a path relative to the working dir, but it can be an // absolute directory reference. It is what we get. // For internal use. ContentDir string // Global config. // For internal use. Cfg config.Provider // Language specific config. // For internal use. LocalCfg config.Provider // Composite config. // For internal use. config.Provider // contains filtered or unexported fields }
Language manages specific-language configuration.
func NewDefaultLanguage ¶
NewDefaultLanguage creates the default language for a config.Provider. If not otherwise specified the default is "en".
func NewLanguage ¶
NewLanguage creates a new language.
func (*Language) GetLocal ¶
GetLocal gets a configuration value set on language level. It will not fall back to any global value. It will return nil if a value with the given key cannot be found. For internal use.
func (*Language) IsSet ¶
IsSet checks whether the key is set in the language or the related config store. For internal use.
type Languages ¶
type Languages []*Language
Languages is a sortable list of languages.
func (Languages) AsOrdinalSet ¶
func (Languages) IsMultihost ¶
IsMultihost returns whether there are more than one language and at least one of the languages has baseURL specificed on the language level.
type LanguagesConfig ¶
type LanguagesConfig struct {
Languages Languages
}
func LoadLanguageSettings ¶
func LoadLanguageSettings(cfg config.Provider, oldLangs Languages) (c LanguagesConfig, err error)