1- # Basic DOMStack Example
1+ # Basic DOMStack Example with TypeScript
22
3- This example demonstrates a fundamental website built with DOMStack, showcasing core features without advanced customization.
3+ This example demonstrates a fundamental website built with DOMStack using TypeScript , showcasing core features without advanced customization.
44
55## Overview
66
77The basic example illustrates:
8- - Multiple page types (Markdown, HTML, JavaScript)
8+ - Multiple page types (Markdown, HTML, JavaScript/TypeScript )
99- Layout system and page nesting
1010- Asset handling
11- - Client-side JavaScript integration
11+ - Client-side TypeScript integration
1212- CSS styling (global and page-specific)
1313- Variables and metadata
14+ - TypeScript integration with proper type definitions
1415
1516## Getting Started
1617
@@ -41,34 +42,46 @@ The built site will be in the `public` directory.
4142
4243```
4344src/
44- ├── layouts/ # Layout templates
45- │ ├── root.layout.js # Main layout
46- │ └── child.layout.js # Nested layout
47- ├── md-page/ # Markdown page examples
48- ├── js-page/ # JavaScript page examples
49- ├── html-page/ # HTML page examples
50- ├── global.css # Global styles
51- ├── global.client.js # Global client-side JavaScript
52- ├── global.vars.js # Global variables
53- └── README.md # Main content (becomes index.html)
45+ ├── layouts/ # Layout templates
46+ │ ├── root.layout.ts # Main layout (TypeScript)
47+ │ └── child.layout.ts # Nested layout (TypeScript)
48+ ├── md-page/ # Markdown page examples
49+ │ ├── page.vars.ts # Page variables (TypeScript)
50+ │ └── client.ts # Page-specific client script (TypeScript)
51+ ├── js-page/ # JavaScript page examples (kept as JS for demonstration)
52+ │ ├── loose-assets/ # Contains TypeScript files
53+ │ │ ├── page.ts # TypeScript page
54+ │ │ ├── client.ts # TypeScript client
55+ │ │ └── shared-lib.ts # TypeScript shared library
56+ ├── html-page/ # HTML page examples
57+ │ └── client.ts # Page-specific client script (TypeScript)
58+ ├── global.css # Global styles
59+ ├── global.client.ts # Global client-side TypeScript
60+ ├── global.vars.ts # Global variables (TypeScript)
61+ └── README.md # Main content (becomes index.html)
5462```
5563
56- ## Key Features Demonstrated
64+ ### Key Features Demonstrated
5765
5866### Page Types
5967- ** Markdown pages** - Simple content authoring with frontmatter
60- - ** JavaScript pages** - Dynamic content generation with full JS capabilities
68+ - ** JavaScript/TypeScript pages** - Dynamic content generation with full JS/TS capabilities
6169- ** HTML pages** - Direct HTML control for complex layouts
6270
6371### Layouts
64- The example demonstrates DOMStack's layout system with nested layouts that wrap page content.
72+ The example demonstrates DOMStack's layout system with nested layouts that wrap page content, fully typed with TypeScript interfaces .
6573
6674### Assets
6775Static assets like images are co-located with content and automatically copied to the output directory.
6876
6977### Styling
7078Both global and page-specific CSS is demonstrated, showing how to scope styles appropriately.
7179
80+ ### TypeScript Integration
81+ - ** Strong typing** - Full TypeScript support with interfaces for layouts, pages, and components
82+ - ** JSDoc example** - The js-page directory is kept as JavaScript with JSDoc comments to demonstrate compatibility
83+ - ** Type definitions** - Proper type definitions for page variables, layout functions, and client scripts
84+
7285## Learn More
7386
7487This is one of several examples in the DOMStack repository. For more advanced features, check out the other examples like:
@@ -77,4 +90,4 @@ This is one of several examples in the DOMStack repository. For more advanced fe
7790- tailwind
7891- and more...
7992
80- For complete documentation, visit the [ DOMStack GitHub repository] ( https://github.com/bcomnes/domstack ) .
93+ For complete documentation, visit the [ DOMStack GitHub repository] ( https://github.com/bcomnes/domstack ) .
0 commit comments