zigmium
v1.0.10
Published
![Logo](https://i.imgur.com/3xXqhtN.png)
Downloads
3
Readme
Zigmium
This project was started with an idea to create a static site generator using Svelte. Few requirement for this framework were:
- Every page is bundled into single HTML file,
- Bundle will include minified Javascript,
- Bundle will include minified CSS,
- Framework must support page template.
With this in mind project was started and results were very interesting which is the reason for publishing this Github repository. If you have some ideas on how to make this framework better, please contact me.
Basic understanding
build.ts
is the main entry for bundling and creating static content.
- First of all static content is loaded in memory,
- After that file tree is created for root directories
src/pages
andsrc/templates
, - From file tree, rollup bundle is created, in memory, for each page and page template,
- With this information in memory, build process is started,
- Find rollup for current page,
- Bundle page information,
- Lead
html
,css
andjs
src into page, - Find all PL_VARIABLES in
js
src, - Pull
css
classes from src, - If page is TEMPLATE and function
modifyTemplate
is available inzigmium-node.js
file, call it, - If function
modifyPage
is available inzigmium-node.js
file, call it, - Minify CSS classes and variables in src,
- Inject CSS into JS bundle,
- Inject PL_VARIABLES into JS bundle,
- Inject JS bundle into page HTML,
- Lead
- Add bundled page to page buffer,
- Call function
finalize
fromzigmium-node.js
file.