docs: per-page templating
Anirudh icyph0x@pm.me
Thu, 21 Jun 2018 10:50:50 +0530
1 files changed,
13 insertions(+),
2 deletions(-)
jump to
M
README.md
→
README.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