1 min read
pyssg.plugins.permalink
Permalink plugin.
Generator that turns each markdown Document into an output Page with a
URL. The default route is file-based (content/guide/intro.md ->
/guide/intro/; an index file maps to its directory root). The frontmatter
keys permalink / url override it, and template selects the layout
template.
A route tap may veto a page by routing it to the empty string: when the
final URL is "" the generator emits no page. Plugins use this to suppress
output (e.g. the i18n plugin drops documents outside any locale directory).
Each document page is given a concrete template: the frontmatter template
if set, otherwise the layout's default_template. This makes template=None
mean exactly "emit the body verbatim, no layout" -- the contract the render
plugin relies on so summarizer pages (sitemap/rss/llms) stay raw. When there is no
layout at all, the template stays None and the render plugin emits raw anyway.
compute_url(node: Node) -> str
File-based URL with frontmatter override.
class PermalinkPlugin
Generates a routed Page per document.
PermalinkPlugin.apply(self, builder: Builder) -> None
permalink() -> PermalinkPlugin
Factory used in pyssg.config.py.