| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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;
-
- 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 - it will use its default current_path
- // Pages that need to set a specific current path should do so in their own prepare()
- nav = get_component_child<NavSidebarComponent>("nav");
- }
- }
|