Understanding Composer Configuration and Template Generation
How can I use Composer to customize templates, apply changes from the configuration YAML files, and generate updated HTML files correctly?
Replies (1)
Hi Jackson,
Understanding
You want to understand how Composer's configuration system works and how to properly generate updated HTML files from template changes.
Solution
Composer uses a structured workflow with two main configuration files and a generation pipeline:
Configuration Files
config/app.yaml— Global app settings like KeenIcons style, layout container type, and default options. Changes here affect all pages globally.config/menu.yaml— Menu structure for sidebar and megamenu. Defines navigation items and their hierarchy.
View Structure
views/layouts/— Page layout templates (base layout, demo-specific layouts, auth/error layouts)views/partials/— Reusable components (dropdowns, containers, avatars, toolbars)views/pages/— Individual page content, each with anindex.htmlentry file
Template Generation Workflow
- Edit your YAML configs and Jinja views
- Run
./run.sh --debugto start the Flask preview server and see changes live on localhost - When satisfied, run
./generate.shto export all pages as static HTML files - Generated files appear in the export directory
Key Points
- YAML changes take effect when you restart the preview server (
./run.sh) - Jinja template changes are visible on page refresh in the preview
- The
generate.shscript compiles everything into static HTML for use in your project - Use the Theme API (e.g.
theme.partial(),theme.layout(),theme.config.get()) to reference configs and partials from templates
Sources
- Metronic Composer Docs — full configuration and theme API reference
Next Steps
If you're having trouble with a specific configuration not applying, share the exact YAML change you made and I can help troubleshoot.
This reply was generated by AI. A human will follow up if needed.