My MiniJinja Starter Template
Ready To Copy/Paste
This is the basic MiniJinja1 code I use to get started with a new project:
---
minijinja =
---
use ;
use SyntaxConfig;
Hello, MiniJinja!
Custom Tokens vs. Default Tokens
I use custom tokens for my MiniJinja projects. They are changed using the .set_syntax
call in the get_env
function. Specifically:
-
{% %}
becomes[! !]
-
{{ }}
becomes[@ @]
-
{# #}
becomes[# #]
If find the square brackets easier to track visually. I also find hitting Shift+1 easier than hitting Shift+5.
You can switch to the default tokes by replacing:
let mut env = get_env;
in the main
function with:
let mut env = new;
and then deleting the get_env
function.
My Go-To Engine
I use MiniJinja for Neopoligen2. My site is currently 2,963 pages. It outputs in less than 10 seconds with an empty cache3. I could probably add some optimizations, but it's plenty fast for me as is. I've yet to run into something that I can't get it to do.
Definitely worth checking out if you're in the market.
-a
Footnotes
My personal website builder.
And about 1 second with a warm cache.