mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
951 B
951 B
| title | aliases | tags | sr-due | sr-interval | sr-ease | ||
|---|---|---|---|---|---|---|---|
| 11-view-templates |
|
2022-12-01 | 40 | 250 |
view templates
pug
pug is a view engine.
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'pug')
a pug file
- defines an html template
e.g.,
doctype html
head
title Pug
script(type= "text/javascript").
if (foo) bar(1 + 5)
body
h1 Pug - node template engine
#container.col //auto makes div with classs
p You are amazing
p Pug is a terse and simple templating language.
extending views
- you can declare a base template and then extend it, replacing jus the bits you want to change

