Documentation
¶
Index ¶
- func BuildTaxonomiesForLanguage(langCode string, pages []*content.Page) map[string]interface{}
- func ContentTreeRoute(langCode string) string
- func FilterByLanguage(pages []*content.Page, langCode string) []*content.Page
- func LanguageData(ctx LanguageContext) map[string]interface{}
- func LanguageSiteTitle(globalTitle string, langCfg *config.LanguageConfig) string
- func LinkTranslations(pages []*content.Page, languages []string) error
- func OutputPrefix(langCode string, isRoot bool) string
- type LanguageContext
- type TranslationInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTaxonomiesForLanguage ¶
BuildTaxonomiesForLanguage generates taxonomy pages scoped to a specific language.
func ContentTreeRoute ¶
ContentTreeRoute determines the content directory path for a language. Returns "content/<lang>/" for language-specific content trees.
func FilterByLanguage ¶
FilterByLanguage filters a page slice to only include pages for a given language.
func LanguageData ¶
func LanguageData(ctx LanguageContext) map[string]interface{}
LanguageData returns the site.language data cascade entry for a language context.
func LanguageSiteTitle ¶
func LanguageSiteTitle(globalTitle string, langCfg *config.LanguageConfig) string
LanguageSiteTitle returns the site title for a specific language, using the language-specific override if available, falling back to global title.
func LinkTranslations ¶
LinkTranslations connects pages across languages by matching relative paths. It strips any leading language prefix (matching entries in `languages`) from RelPath before grouping, so "en/about.md" and "fr/about.md" are linked.
func OutputPrefix ¶
OutputPrefix returns the output directory prefix for a language. Root languages output at "/" (empty prefix); non-root get "lang/" prefix.
Types ¶
type LanguageContext ¶
LanguageContext holds the active language state during a build.
func BuildLanguageContexts ¶
func BuildLanguageContexts(cfg map[string]*config.LanguageConfig) ([]LanguageContext, error)
BuildLanguageContexts creates a LanguageContext for each declared language. Returns contexts sorted by weight (lowest first = default language).
type TranslationInfo ¶
TranslationInfo holds URL and language code for a page translation.
func GetTranslations ¶
func GetTranslations(page *content.Page) []TranslationInfo
GetTranslations returns translation info for a page's linked translations.