| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using Astralis;
- using Spry;
- using Inversion;
- /**
- * MainTemplate - The base template for documentation pages
- *
- * Provides a clean, minimal HTML structure for documentation:
- * - HTML5 document structure
- * - NavSidebarComponent for navigation
- * - docs.css stylesheet for documentation styling
- * - htmx.js and htmx-sse.js for interactive components
- * - Template outlet for page content
- */
- public class MainTemplate : PageTemplate {
-
- private NavSidebarComponent nav;
- private RouteContext route_context = inject<RouteContext>();
-
- public override string markup { get {
- return """
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Spry Documentation</title>
- <link rel="stylesheet" spry-res="docs.css">
- </head>
- <body>
- <div class="page-container">
- <spry-component name="NavSidebarComponent" sid="nav"/>
- <main class="main-content">
- <spry-template-outlet/>
- </main>
- </div>
- <script spry-res="htmx.js"></script>
- <script spry-res="htmx-sse.js"></script>
- </body>
- </html>
- """;
- }}
-
- public override async void prepare() throws Error {
- // Get the nav component and set the current path from the route context
- nav = get_component_child<NavSidebarComponent>("nav");
- nav.current_path = route_context.requested_path;
- }
- }
|