(sigil publish generate)
(sigil publish generate) - Content Generation Pipeline Stages
Pipeline stages that generate synthetic content items from existing items (collection pages, RSS feeds, sitemaps, etc).
Exports
collection-pageprocedureCreate a pipeline stage that generates a collection index page.
Filters items with the match predicate, sorts them, and creates a synthetic item that renders as a listing page.
(collection-page
match: (has-tag? "post")
title: "Blog"
output: "/blog/index.html"
sort-by: date:
sort-order: 'descending)sxml-pageprocedureCreate a pipeline stage that adds a custom SXML page.
The content can be either:
- Direct SXML: a list like
(div (h1 "Hello")) - A function:
(lambda (config state) sxml)for dynamic content
;; Static content
(sxml-page
path: "/about"
title: "About"
content: `(div (h1 "About Us") (p "We build things.")))
;; Dynamic content with access to config/state
(sxml-page
path: "/stats"
title: "Site Stats"
content: (lambda (config state)
`(div (p "Total pages: " ,(length (state-items state))))))has-tag?procedureCreate a predicate that checks if item has a specific tag.
(filter (has-tag? "published") items)has-metadata?procedureCreate a predicate that checks if item has a metadata key.
(filter (has-metadata? nav-group:) items)matches-path?procedureCreate a predicate that checks if item path matches a pattern.
(filter (matches-path? "/posts/") items)