FastCentrik custom template compiler
This is a custom template compiler for FastCentrik. It allows you to create templates with and compile them into injectable JavaScript.
How does it work
First in your project you have your pages, for each page you have your own set of patches.
For determining the page you can either use regex, file route.regexpr, simple pathname route file, or custom JavaScript function that has to return boolean, file route.js.
Each page is folder in the root of your project. Patches in pages can be stacked so multiple pages may be triggered at the same time. For example you can create page with name "global" that has this regex: ^[\s\S]*$ and patches in this page will be used throughout the whole webpage.
Each page can have multiple patches, that are in the templates folder in the page folder. There are 2 types of patches:
- Custom patches This patch can have only style.css that is not scoped and script.js. These are just normally injected into the project and can be used for minor modifications or for global styles.
- Template patches These patches are more complex and are expplained in TEMPLATE_PATCHES.md
Known bugs
- You can't use
@keyframein the scoped .css file (in the templates folder). You will have to define your keyframe in your global CSS file for the specific page.
TODO
- Add option to disable the default styles