article

package
v0.9.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package article turns a request path into the page it names and the parameters riding along with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeTarget

func CodeTarget(name string, params Params) (target string, ok bool)

func Encode

func Encode(p Params) string

Encode writes the parameters back as a path, sorted by key. Only the values are escaped, and only the first bare key survives.

func RedirectTarget

func RedirectTarget(name string, params Params) (target string, ok bool)

RedirectTarget is the Location a request gets when it names a page by anything other than the normalized name. ok is false when the name already is one.

func ThisPage

func ThisPage(params Params, canonicalURL string) func(string) (string, bool)

ThisPage answers the substitutions only the request can answer. The name it is handed keeps its case while the key it looks up does not, so %%PATH|a%% resolves to nothing at all.

Types

type Param

type Param = page.PathParam

type Params

type Params = page.PathParams

func ParsePath

func ParsePath(raw, homePage string) (string, Params)

ParsePath reads the path with the leading slash already gone. homePage is the site's own setting, which only an empty name reaches for.

Jump to

Keyboard shortcuts

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