ingest_content

SolidGroundUX DocumentationSolidGroundUX
NL

fn: ingest_content

Purpose

Normalize and archive incoming Markdown into canonical source content.

Signature

def ingest_content(source: str | Path, input_file: str | Path, *, title: str, language: str, parent: str, kind: str, slug: str, summary: str='', commit: bool=True) -> IngestResult:

Arguments

  • source: Website source root directory.
  • input_file: Path to the incoming Markdown source.
  • title: Human-readable content title.
  • language: Language code of the requested content.
  • parent: Destination parent section or route.
  • kind: Content kind, such as page, section or article.
  • slug: URL-friendly final route component.
  • summary: Optional short description of the content.
  • commit: Whether to write the validated ingest operation.

Usage

# Preview normalized destination and metadata without writing.
preview = ingest_content(source, input_file, title="Example", language="NL",
                         parent="/", kind="page", slug="example", commit=False)
# Commit the reviewed page into the canonical content tree.
result = ingest_content(source, input_file, title="Example", language="NL",
                        parent="/", kind="page", slug="example", commit=True)