Documentation

DOC / 05 / 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 loopRouting and pagesRust viewsEvents and foldsSchemas and snapshotsHyphae verified syncTyped contentBrowser runtimeDOM ownershipAdaptive assetsArtifact trustErrors and diagnosticsBuild and deployCrates and APILicensing and policy

Author a complete page

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

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

A Page owns its route, Head, body, 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(),
));