Add book catalog example with global/local template system
Features:
- Global template configuration (sqlite_global_templates directive)
- Template path resolution relative to location
- Automatic template loading from directories
- Local templates override global templates
- Content handler installation via directive setter
Book Catalog Example:
- Complete working example with 10 technical books
- SQLite database with setup script
- 4 browseable pages (all, programming, databases, computer-science)
- Shared global templates (header, footer, book_card partial)
- Category-specific local templates with unique theming
- Responsive gradient UI design
- Working navigation and filtering
Configuration:
- sqlite_global_templates: HTTP main-level directive for shared templates
- sqlite_template: Location-level directive (sets content handler)
- Template resolution: {doc_root}{uri}/{template_name}
- All .hbs files in directories auto-loaded as partials
Technical improvements:
- Fixed content handler setup (not phase handler)
- Proper HttpModuleMainConf and HttpModuleLocationConf traits
- Template directory scanning and registration
- Error handling with debug logging
This commit is contained in:
16
server_root/global_templates/book_card.hbs
Normal file
16
server_root/global_templates/book_card.hbs
Normal file
@ -0,0 +1,16 @@
|
||||
<div class="book-card">
|
||||
<div class="book-header">
|
||||
<h3 class="book-title">{{title}}</h3>
|
||||
<div class="book-rating">⭐ {{rating}}</div>
|
||||
</div>
|
||||
<p class="book-author">by {{author}}</p>
|
||||
<p class="book-description">{{description}}</p>
|
||||
<div class="book-details">
|
||||
<span class="book-genre">{{genre}}</span>
|
||||
<span class="book-year">{{year}}</span>
|
||||
{{#if isbn}}
|
||||
<span class="book-isbn">ISBN: {{isbn}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user