Currently Work in Progress
A Framework Agnostic HTML attribute driven Javascript router. Intended for SSR/SSG designed web applications.
- Swap layouts
- Easily prefetch routes.
- Nested/Named Layouts
- Framework Agnostic
- Built with Pure Typescript
- Easily Update Meta Data
- Easily Update Head Tags From Server
- data-glue-page - Root container that gets replaced on route navigation.
- EXAMPLE:
<main data-glue-page>
- EXAMPLE:
- data-glue-layout - Named layout for nesting. Allows the ability to keep layout content while switching pages.
- EXAMPLE:
<div data-glue-layout="dashboard"
- EXAMPLE:
- data-glue-script - Scripts belonging to this page/layout. Deduped and parsed by glue-router when routing.
- EXAMPLE:
<script data-glue-script src="/app.js">
- EXAMPLE:
- data-glue-head - Head Tag that is intended to replace the current element when pages are swapped. It works be merging the children of the new head tag.
-
EXAMPLE:
<head data-glue-head> // This head will replace the current head <title>New Page Title</title> // This title will be updated </head>
-
- data-glue-run-once - Executes script tags only the first time ever.
- data-glue-run-always - Re-execute on every visit to this page/layout
- data-glue-scroll="reset | restore | none" - Default is to reset the scroll position. Restore is to restore the scroll position on back and forward and none is to do nothing.