Last active
April 15, 2017 07:18
-
-
Save mlrawlings/48bbdd2a3d2f528c979de1f411b777a2 to your computer and use it in GitHub Desktop.
Pug vs Marko: Layouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
head | |
title -- My Site - ${input.title} | |
include(input.scripts) | |
if(!input.scripts) | |
script src='/jquery.js' | |
body | |
include(input.content) | |
include(input.foot) | |
if(!input.foot) | |
#footer | |
p -- some footer content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
head | |
title My Site - #{title} | |
block scripts | |
script(src='/jquery.js') | |
body | |
block content | |
block foot | |
#footer | |
p some footer content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include('./layout.marko') | |
@scripts | |
script src='/jquery.js' | |
script src='/pets.js' | |
@content | |
h1 -- ${input.title} | |
$ var pets = ['cat', 'dog'] | |
for(petName in pets) | |
include('./pet.marko') name=petName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends layout.pug | |
block scripts | |
script(src='/jquery.js') | |
script(src='/pets.js') | |
block content | |
h1= title | |
- var pets = ['cat', 'dog'] | |
each petName in pets | |
include pet.pug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p -- ${input.name} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p= petName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment