Skip to content

Instantly share code, notes, and snippets.

@mfd
Last active November 21, 2016 09:19
Show Gist options
  • Save mfd/2b555715fb0a0c8ef42ad4eaa22b00d4 to your computer and use it in GitHub Desktop.
Save mfd/2b555715fb0a0c8ef42ad4eaa22b00d4 to your computer and use it in GitHub Desktop.
jade menu
//- index.pug
extends layout
append sharedVars
- var pageUrl = 'about.html';
block title
| My title
block content
h1 Мой заголовок
.content
p Hello World
//- menu.pug
- var nav = [{url: '/', name: 'Home'}, {url: 'about.html', name: 'About'}];
mixin navItem(url, name, current)
li.nav-item(class={active: current})
a.link(href=url)= name
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment