Documentation
¶
Index ¶
- func ContainsLiquidTags(s string) bool
- func DefaultFromPath(relPath string) string
- func Resolve(pattern string, page *content.Page, renderers ...PermalinkRenderer) (string, error)
- func ResolveAliases(page *content.Page) ([]string, error)
- func ResolveFromCascade(page *content.Page, cascadeData map[string]interface{}, ...) (string, error)
- func ResolveTokens(pattern string, page *content.Page) string
- type PermalinkRenderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsLiquidTags ¶
ContainsLiquidTags returns true if the string contains {{ }} Liquid expressions.
func DefaultFromPath ¶
DefaultFromPath computes the default URL from a content file's relative path.
func Resolve ¶
Resolve computes the output URL for a page using config patterns and front matter overrides. When a front matter permalink contains {{ }}, it is rendered through the provided renderer. Token syntax and template syntax are mutually exclusive — when {{ is detected, tokens like :year and :slug are not resolved.
func ResolveAliases ¶
ResolveAliases returns all alias output paths for a page, as specified in the page's front matter "aliases" list. These are additional output locations for the same rendered content — not redirects.
func ResolveFromCascade ¶
func ResolveFromCascade(page *content.Page, cascadeData map[string]interface{}, renderers ...PermalinkRenderer) (string, error)
ResolveFromCascade computes the output URL for a page using permalink patterns from the _data.yaml cascade. The lookup order is:
- Front matter permalink (static or template)
- Cascade "permalink" pattern from _data.yaml (supports both tokens and templates)
- File path default (DefaultFromPath)