all repos — py-vite @ d4862c738494e9ac820a01d235116a56a2f22906

the original vite, written in python

docs: per-page templating
Anirudh icyph0x@pm.me
Thu, 21 Jun 2018 10:50:50 +0530
commit

d4862c738494e9ac820a01d235116a56a2f22906

parent

9b2de831a02abd54dc463b6c6d09c2ee2d5f317c

1 files changed, 13 insertions(+), 2 deletions(-)

jump to
M README.mdREADME.md

@@ -59,7 +59,7 @@

Vite uses Jinja2 templating, so template files must be placed in a separate `templates/` directory. A basic example would be: ```html -<link rel="stylesheet" href="../static/sakura-earthy.css"> +<link rel="stylesheet" href="/static/sakura-earthy.css"> <title> {{ title }} </title>

@@ -71,11 +71,22 @@ <footer>

{{ footer }} </footer> ``` +### Specifying per-page templates +Vite allows for specifying a unique template, per page. This is acheived by including YAML frontmatter at the top of the Markdown file, like so: + +```markdown +--- +template: foo.html +--- + +## markdown here +... +``` + ### Notes on templating - Stylesheets, images and JS can be accessed from the `static` folder. - `index.html`, i.e. your website's homepage, should be `_index.md` in the `pages/` directory. - Directory tree