Skip to content

Site

nodekit.build_site

build_site(
    graph: Graph,
    savedir: PathLike | str,
    slug: str | None = None,
) -> BuildSiteResult

Build a static website for a Graph and save it to disk.

Parameters:

  • graph (Graph) –

    Graph to serialize and render into a site.

  • savedir (PathLike | str) –

    Directory to write the site into.

  • slug (str | None, default: None ) –

    Optional human-readable URL slug for the entrypoint HTML file.

Returns:

  • BuildSiteResult

    BuildSiteResult with the site root, entrypoint, and dependency list.

Raises:

  • ValueError

    If savedir is not a directory.

  • ValueError

    If slug is invalid or collides with a different built Graph.

Site layout
assets/
    {mime-type-1}/{mime-type-2}/{sha256}.{ext}
runtime/
    nodekit.{js-digest}.js
    nodekit.{css-digest}.css
graphs/
    {graph_digest}.html (if slug is None)
    {slug}.html (if slug is provided)

nodekit.SiteSubmission pydantic-model

Fields:

platform_context pydantic-field

platform_context: PlatformContext

Information about the platform (if any) that the Graph site was hosted on.

trace cached property

trace: Trace

Decompresses and decodes the gzipped base64 Trace.

Returns:

  • Trace

    Decompressed Trace object.

trace_gzipped_base64 pydantic-field

trace_gzipped_base64: str

The submitted Trace as base64-encoded gzipped JSON bytes.