← Back to Home

How to Build Lit Pages with Server-rendered Shell Routes

Updated March 5, 2026
lithonoserver rendered shellimportmapweb components

Lit Pages with Server-rendered Shells

Serve an HTML shell from Hono and hydrate per-page Lit components via module scripts.

Routing Pattern

Template Helper

Use a shared template builder for all pages:

renderPageTemplate({ title, description, componentName, scriptPath })
renderPageTemplateWithProps({ ..., props: { videoId } })

Why This Works Well

Safety Note

Escape route props before injecting as HTML attributes to prevent XSS.