Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAllison Hanna
36,222 PointsJade-->Pug
jade@1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
Devstatement https://github.com/pugjs/pug/issues/2184
Joseph Guerra
20,674 PointsYes, the Pug github is here: https://github.com/pugjs/pug
10 Answers
Dave McFarland
Treehouse TeacherI've started using Pug (instead of the Jade module):
npm install pug --save
Then I name all my files with the .pug
extension like layout.pug
. In my Express app, I use the Pug templating engine:
// view engine setup
app.set('view engine', 'pug');
app.set('views', __dirname + '/views');
This works just fine.
Tommy Gebru
30,164 PointsWhen using Jade === Pug, how can I add an Icon using font awesome icons??
Anthony Albertorio
22,624 PointsIf you are using sublime text, adding support to view the pug mark up will be helpful. Just press Command + Shift + P (for Mac) or click on Sublime Text > Preferences > Package Control to open package control. Type "Install Package". Then, type in pug. You are good to go.
fredyrosales
10,572 PointsDoes npm install pug --save still work? I think it's just me for some odd reason i'm getting an error.
Edit ** Github, Twitter exc are currently down. Which is why i think i can't install.
Nicolas Hampton
44,638 PointsPretty sure that's because npm is down do to the DDoS attacks today as well. npmjs.com doesn't seem to resolve for me either right now.
Karen Rulander
20,520 PointsFYI: The jadelang.net website states at the bottom: 'the domain name has expired.' When you click on 'Jade' it take me to a website where I can buy Jade (the gemstone)!
James Anwyl
Full Stack JavaScript Techdegree Graduate 49,960 PointsRemoved the link thanks for pointing it out :)
Clark Winters
Full Stack JavaScript Techdegree Graduate 16,672 PointsThis is a little late to the party but if anyone else finds this and needs a way to convert several jade files to pug, you can run the following in terminal:
for file in *.jade; do name=$(echo $file | cut -d '.' -f1); mv $file $name.pug; done
Jonathan Grieve
Treehouse Moderator 91,253 PointsJade has still installed for me despite all the warnings. Would it still work?
In pug do we still use .jade files? :-)
Nicolas Hampton
44,638 PointsI've found that it still works, but it's anything but safe. If you expect a project to last or are working on something now, I would definitely change over.
Tata Gelashvili
3,076 PointsI thing we should use .pug files but syntax is same.
Edgar Lizcano Sosa
Courses Plus Student 11,152 Pointsjust switch .jade to .pug and it should work ;3
Donnie Reese
17,211 PointsFrom what I read on the Pugjs github page, it says that they did obtain permission to continue to allow people to install the original Jade package, but only up to a certain version is it called jade. Any updates after that were under the pug package.
The Machine
10,221 PointsIs there a browser based translator, liked shown for JADE in the video, for pug?
hchris
Courses Plus Student 11,116 PointsThe browser translator is still up and should work for testing pug. I have yet to find a difference between the two other than the name.
Waldo Alvarado
16,322 PointsHere is how you use pug.
1) Name your template: index.pug
2) npm install pug --save
3) the below should go in your app.js
app.set('view engine', 'pug');
app.set('views', __dirname + '/templates');
app.get('/', function(req, res){
res.render('index');
});
Bryan LeBlanc
2,482 Pointsmake sure you add "npm install" into terminal after "npm install pug --save"
Geoffrey Emerson
18,726 PointsGeoffrey Emerson
18,726 PointsAlso people should note that the transition to the new name is not perfect. As of this writing, jade-lang.com is still working correctly and pug-lang.com is not. There are some other broken links on the github pages as well. These little hiccups will be happening for a while. Eventually jade-lang.com will either stop working or redirect to pug-lang.com or something similar.