layout.jade
doctype 5
html.no-js(lang='en')
block vars
head
title #{title}
meta(name='description', content='#{description}')
body
block content
page.jade
extends layout
block vars
- var title='Home'
- var description = 'Welcome to my page'
block content
p Hello world!
This solution came from Jade issue discussion.
Thanks for this! This is way more popular https://stackoverflow.com/questions/29089925/pass-variables-to-base-layout-from-extending-pug-jade-template, but yours is more descriptive w/ an example of how to do it.