Commit a2aaa83
committed
feat(preact+landing): enable Preact block rendering + reusable landing page content system
## Preact Block Integration
- Enable Preact component detection for data-driven pages:
- Fix init.html to resolve sections_source + per-section ref before Preact detection
- Correct resource paths: blox/* → js/hbx/blocks/* (Hugo module mounts)
- Update libraries.html to load Preact core + compiled block scripts
- Add dynamic icon rendering for Preact components:
- Create Icon.jsx component with SVG decoding
- Add get_icon_data.html partial for passing icon strings to Preact props
- Update preact-wrapper.html to fetch icon data and inject into props
- Wire hero component to render dynamic icons via <Icon svg={icon_svg} />
- Centralized logging system:
- Add functions/logger.html to wrap warnf/errorf safely
- Degrade to HTML comments in constrained contexts (content adapters)
## Reusable Landing Page Content System
- Add sections_source support:
- Page front matter: sections_source: pages/<key> loads base from data/pages/<key>.yaml
- Inline sections deep-merge over base by position; extras appended
- Add per-section ref system:
- Any section: ref: blocks/<slug> loads from data/blocks/<slug>.yaml
- Inline section properties deep-merge over ref (content/design submaps)
- Enable content reuse across multiple landing pages
- Create reusable block library:
- Add test/data/blocks/: hero_basic.yaml, features_basic.yaml
- Add test/content/linked/index.md demo using refs with overrides
- Add pragmatic deep merge for content/design override handling
## Infrastructure & Schemas
- Update base-block.json schema:
- Fix gradient structure: flat → nested (gradient.start/end/direction)
- Fix color structure: string|{light,dark} (matches parse_block_v3.html)
- Update hero schema to properly extend base via $ref
- Fix Tailwind source path generation:
- Add tailwind_sources.html with test vs starter site logic
- scripts/view-test.sh: export HUGO_BLOX_TEST_SITE=true
- Update block directory structure:
- blox/<name>/config.html (was blox/<name>--CONFIG.html)
- Apply to init.html + parse_block_v2.html
- Code quality improvements:
- Biome config: match Prettier rules
## Content Adapters (Removed)
- Investigated Hugo content adapters for landing pages
- Found execution context limitations (early build phase, limited site methods)
- Archived to backups/content-adapters-*.zip and removed from test site
- Decision: use standard pages + data linking instead of adapters
This enables dynamic Preact rendering with proper icon support while providing a flexible, reusable content system for landing pages that maintains the "single file = page" mental model with optional advanced linking.1 parent 0c43c90 commit a2aaa83
53 files changed
Lines changed: 8825 additions & 5637 deletions
File tree
- modules/blox-tailwind
- assets
- css
- config
- dist/lib
- alpinejs
- katex
- markmap
- mermaid
- plotly
- preact
- js
- blox
- hero
- layouts/_partials
- blox
- hero
- functions
- hbx
- scripts
- test
- content
- linked
- data
- blocks
- pages
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
| |||
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 60 | | |
47 | 61 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
0 commit comments