Documentation

DOC / 06 / AUTHOR

Routing and pages

Create complete HTML documents, canonical metadata, clean routes, redirects, and authored error pages.

In this guideRouting and pages
Getting startedProject structureCLI referenceDeveloper loopIncremental buildsRouting and pagesRust viewsEvents and foldsSchemas and snapshotsHyphae verified syncTyped contentBrowser runtimeDOM ownershipNative runtime previewPortable deploymentFull-stack betaOpenSDK previewComponents and languagesBrowser framework conformanceTooling protocolCompatibility and deprecationAdaptive assetsArtifact trustRelease trustPerformance evidenceErrors and diagnosticsVoluntary telemetryBuild and deployCrates and APILicensing and policy

Author a complete page

rust
use pliego_dom::{IntoView, el};
use pliego_ssg::{Head, Page};

let page = Page::lazy(
    "/guide",
    Head::new("Guide | My App")
        .description("A complete authored page.")
        .canonical("https://example.com/guide"),
    ["src/main.rs", "content/guide.md"],
    || el("main")
        .child(el("h1").child("Guide"))
        .into_view(),
);

A Page owns its route, Head, renderer, source dependencies, and optional language. PliegoRS emits useful HTML directly; routing does not begin as a client-side application shell.

Route normalization

Clean routes publish to index documents. /guide and /guide/ resolve to guide/index.html. Distinct authored routes that normalize to the same portable output are rejected before staging.

Authored error pages

Every maintained starter emits /404.html. The preview server returns that document with HTTP 404 for unknown routes. If it is missing, PliegoRS serves a branded fallback that explains how to add one.

rust
site.page(Page::new(
    "/404.html",
    error_head("Route not found"),
    not_found(),
));