permalink

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsLiquidTags

func ContainsLiquidTags(s string) bool

ContainsLiquidTags returns true if the string contains {{ }} Liquid expressions.

func DefaultFromPath

func DefaultFromPath(relPath string) string

DefaultFromPath computes the default URL from a content file's relative path.

func Resolve

func Resolve(pattern string, page *content.Page) (string, error)

Resolve computes the output URL for a page using config patterns and front matter overrides.

func ResolveAliases

func ResolveAliases(page *content.Page) ([]string, error)

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 ResolveForSection

func ResolveForSection(page *content.Page, permalinkCfg map[string]string) (string, error)

ResolveForSection computes the output URL for a page using section-to-pattern mapping from config. The lookup order is:

  1. Front matter permalink (static or Liquid)
  2. Section-specific pattern from permalinkCfg
  3. "default" pattern from permalinkCfg
  4. File path default (DefaultFromPath)

func ResolveFromCascade

func ResolveFromCascade(page *content.Page, cascadeData map[string]interface{}) (string, error)

ResolveFromCascade computes the output URL for a page using permalink patterns from the _data.yaml cascade. The lookup order is:

  1. Front matter permalink (static or Liquid)
  2. Cascade "permalink" pattern from _data.yaml
  3. File path default (DefaultFromPath)

func ResolveTokens

func ResolveTokens(pattern string, page *content.Page) string

ResolveTokens performs fast token replacement on a permalink pattern.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL