Reference

Fragment Routes

Serve full documents and partial shells from the same Go handlers.

Why fragment routes

RGX can request a fragment URL while keeping the fallback href or form action pointed at the full page. That gives you progressive enhancement without a second client framework.

This site uses `/fragments/...` routes so the browser can swap the shell directly instead of reloading the whole document every time.

/fragments/home
/fragments/docs/getting-started
/fragments/examples

Response shape

The fragment response should include the same `#site-nav` and `#site-main` IDs that the client is targeting. RGX can then swap both regions in one pass.

That makes the nav state stay honest while the main content changes under it.

Swap the shell

When the markup changes, the current RGX demo site swaps both the header and the main content together. It feels much closer to a traditional htmx-style site, but with RGX rules and realtime support.

data-gx-select="#site-nav@outerHTML->#site-nav@outerHTML #site-main@outerHTML->#site-main@outerHTML"