Version 1.0.0
Minjucks is a minimal static site generator (no Markdown) with nunjucks templating, frontmatter, PostCSS stylesheet processing, and CSSNANO minification.
In the terminal, yarn istall will brings in all the node_modules/ required.
-
yarn devfor development with Browser-Sync. -
yarn cleanempties thepublic/folder. -
yarn buildjust builds.
Everything ends up in the public/ folder for you to deploy:
-
src/pagesnunjuck files are used to build HTML files (pretty URLs). You can nest pages in folders, and your folder structure will also be replicated in the publif folder. -
Frontmatter data in your pages nunjuck files (using the gray-matter plugin) is used for
page.titleandpage.descriptionand to select which layout template the page will wear. Minjucks comes with onlylayout.njkut you can create more. -
Site title, description, version, and author are in
src/data/metadata.json -
PostCSS imports CSS partials into
styles.css. CSSNANO minifies it. This one CSS file goes to your site. -
For demonstration purposes:
- Simple site CSS is included. Start here or delete and start over, do whatever you like.
build.jsexpects your base CSS file to besource/css/styles.css– you can change that. - The plain JS
source/js/scripts.cssis a switcher that shows how the CSS light and dark theme works. If you don’t want it, you can delete it.
- Simple site CSS is included. Start here or delete and start over, do whatever you like.
-
Other CSS (e.g. 3rd party framework), JS, images, and fonts are simply passed through (copied) without processing, each in their folders. You can add more folder/file types in
build.jsAny files you put in thesource/root are also simply passed through to thepublic/root.
minjucks/
├── src/
│ ├── _includes/ ← layouts & partials
│ │ └── layout.njk
│ ├── css/
│ │ ├── other/
│ │ │ └── … ← pass-thorugh CSS
│ │ ├── styles.css
│ │ └── …
│ └── data/ ← sitewide data
│ │ └── metadata.json
│ └── js/ ← pass-though js
│ │ └── main.js
│ └── img/ ← pass-thorugh images
│ │ └── logo.svg
│ └── pages/
│ └── index.njk
├── public/ ← built output
├── dev.js
├── build.js
├── postcss.config.js
└── package.json