Node.js
8
Вклад в тег
//- filename: root.jade
- var nav = [{url: '/', name: 'Home'}, {url: 'about.html', name: 'About'}....];
doctype html
html(lang="en")
block sharedVars
head
block title
body
ul.nav
each i in nav
+navItem(i.url, i.name, i.url == pageUrl)
block content
mixin navItem(url, name, current)
li.nav-item(class={active: current})
a.link(href=url)= name
extends root
append sharedVars
- var pageUrl = '/';
block title
| My title
block content
h1 Мой заголовок
.content
p Hello World
server {
listen 80;
server_name example.com;
location /all.css {
root /srv/vek-node/static;
}
location /all.css.map {
root /srv/vek-node/static;
}
location /img {
root /srv/vek-node/static;
}
location /vendors {
root /srv/vek-node/static;
}
location /media {
alias /var/www/vek_staging/media;
}
location /catalog/metal {
rewrite ^ http://metal.example.com$request_uri? permanent;
}
location /admin {
uwsgi_read_timeout 600;
client_max_body_size 30m;
include /etc/nginx/uwsgi_params;
uwsgi_pass unix:/run/uwsgi/app/vek_staging/socket;
}
location /static {
alias /var/www/vek_staging/static;
}
location / {
include /etc/nginx/proxy_params;
proxy_read_timeout 120;
proxy_pass http://127.0.0.1:3331;
}
}