Skip to content

Instantly share code, notes, and snippets.

@dtan
Created July 9, 2011 18:58
Show Gist options
  • Save dtan/1073845 to your computer and use it in GitHub Desktop.
Save dtan/1073845 to your computer and use it in GitHub Desktop.
using partials in express
folder structure:
- views
- login.jade
- partials
- form
- input.jade
// ======= login.jade:
h1= title
form(action="/", method="POST")
!= partial('partials/form/input', { label: { for: 'email', label: 'Email' }, input: { name: 'email', value: '[email protected]', type: 'email' } })
div
label(for="password") Password
input(type="password", name="password", value="")
div
input(type="submit", value="Submit")
// ======= partials/form/input.jade:
div
label(for=label.for)= label.label
input(type=input.type, name=input.name, value=input.value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment