(sigil publish stages)
(sigil publish stages) - Assembly Pipeline Stages
Pipeline stages for filtering, path mapping, navigation building, and cross-reference indexing.
Exports
filter-draftsprocedurePipeline stage that removes draft items.
Checks config options: draft-mode: - if true, keeps drafts. Otherwise, removes items where metadata draft: is true.
filter-itemsprocedureCreate a pipeline stage that filters items with a predicate.
(filter-items (lambda (item) (has-tag? item "published")))compute-output-pathsprocedurePipeline stage that computes output paths.
This is a no-op if paths are already computed during scanning. Can be used with custom path handlers in the future.
build-ref-indexprocedurePipeline stage that builds cross-reference index.
Items with ref-id: metadata are added to the index. Key format: namespace:id or just id if no namespace.
build-path-indexprocedurePipeline stage that builds source-path to URL index.
This enables link rewriting by mapping source file paths to their canonical URLs. Cleans up /index.html to / for nice URLs.
rewrite-linksprocedureTransform that rewrites .md links to their output paths.
Use with config transforms: to automatically fix internal links. Resolves relative links against the current item's source path and looks up the target's output path in the path index.
Transform signature: (config state item node) -> node
resolve-refsprocedureTransform that resolves ref: links to content references.
Looks up ref:key or ref:namespace:id links in the ref-index and rewrites them to the target URL. Emits warnings to stderr for unresolved references.
If link text is empty, auto-fills from the reference title.
Transform signature: (config state item node) -> node
;; In markdown:
;; [First Post](ref:blog:first-post) -> link to blog post
;; [](ref:blog:first-post) -> auto-titled link