lakeport-router defines typed application routes with compiler-checked URL round-trip laws, semantic <a href> navigation, per-route document titles (RouterProps.title), native navigation chrome, and Web static-site pre-rendering (SSG).
Verified URL parsing
Define a Route type and a UrlCodec Route (packages/lakeport-router/src/LakeportRouter/Url.lean), then prove LawfulUrlCodec so formatting a route to URL segments and parsing it back is guaranteed to recover the exact same route:
lean
theorem ofSegments_toSegments (r : SiteRoute) :
SiteRoute.ofSegments (SiteRoute.toSegments r) = some r
UrlCodec.parseUrl returns a Location Route preserving the parsed route alongside optional query and fragment strings; formatUrl reassembles them cleanly.
Links, titles & native navigation chrome
•
Links & titles:<a href="/docs/introduction"> integrates with RouterShell history navigation on Web and deep linking on native. RouterProps.title updates document.title on Web and window titles on desktop hosts.
•
Native mobile & desktop chrome (lakeport-router + lakeport-virtual):StackHeader, NavTabs, ResponsiveSheet, and DrawerShell pair with UI-thread 120Hz edge swipe-back gestures on iOS, predictive-back on Android, draggable detent sheets, safe-area inset handling, and native desktop menu bars.
Web SSG & progressive hydration
To pre-render routes at build time, configure [lakeport.web] in lakefile.toml with mode = "ssg" and an explicit ssgRoutes list:
description = "Reference guides and API documentation."
Run:
sh
lakeportbuildweb . --release
The compiler executes your compiled WebAssembly module at build time to emit static HTML for every listed route, plus dist/web/hydration-manifest.json recording exact artifact hashes, raw/gzip/brotli sizes, and route hydration policies (eager, visible, interaction, idle, static-only).
In --release mode, lakeport build web handles production web delivery directly with no custom post-build scripts:
SEO & static edge headers: Injects per-route <title>, <meta name="description">, <link rel="canonical">, Open Graph, and Twitter Card tags; emits sitemap.xml and robots.txt when siteOrigin is set; and writes _headers + .assetsignore so hashed assets cache immutably while HTML always revalidates.
•
Static passthrough: Any files placed in public/ (such as favicon.ico, apple-touch-icon.png, _redirects, or a custom _headers) are copied verbatim into dist/web/.