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 trial

JavaScript Express Basics (2015) Doing more with Express Making Lists in Jade Templates

fredyrosales
fredyrosales
10,572 Points

[SOLVED] for post in posts

the in in for post in posts is not turning into a property/method. In his code it turns red like a property/method should. mine just stays as regular text. Any help would be highly appreciated.

3 Answers

fredyrosales
fredyrosales
10,572 Points

extends ./layout.pug

block content for post in posts <---- The in is not turning into a property/method section.posts .container .row .col-lg-8.col-lg-offset-2.text-center h2.section-heading #{post.title} hr.light p.text-faded #{post.description} a(href='/blog' + post.title).btn.btn-default.btn-xl Read More!

Miguel Canas
seal-mask
.a{fill-rule:evenodd;}techdegree
Miguel Canas
Python Development Techdegree Student 11,470 Points

So the in in for post in posts is not a property or method, it's just a keyword of the for/in or each/in control statement in PugJS (Jade).

If you're seeing a different color for the in keyword of the control statement, it could be that the syntax highlighting in the instructors editor is different than the syntax highlighting in your editor. This should not affect the results of your code.

For example, if I open that file in my preferred text editor (atom.io), the post in posts is all the same color, but the code works as intended. Different code editors may apply different syntax highlighting depending on your settings and plugins.

Is this the only issue you are seeing or is your code not outputting the expected results?