| title | layout |
|---|---|
I'm not a Portfolio Item! |
post |
Just do not write "portfolio" inside the Front Matter. That's it.
| <!-- the standard loop for all your posts --> | |
| {% for post in site.posts %} | |
| <!-- check if there is a portfolio thing set inside the Front Matter | |
| Note: Do not set "portfolio: false" on normal posts - this is not needed | |
| and could lead to problems | |
| --> | |
| {% if post.portfolio %} | |
| <!-- do nothing here --> | |
| {% endif %} | |
| <!-- then display all the normal posts --> | |
| <article class="post"> | |
| <h2>{{ post.titl }}</h2> | |
| {{ post.excerpt }} | |
| </aticle> | |
| {% endfor %} |
| {% for post in site.posts %} | |
| <!-- again we loop through the posts, because technically the Portfolio Stuff is a post --> | |
| <!-- this time we only want posts where portfolio is true (or set at all) --> | |
| {% if post.portfolio %} | |
| <article class="portfolio--article"> | |
| <!-- the title--> | |
| <h2>{{ post.title }}</h2> | |
| <!-- the content --> | |
| <p>{{ post.content }}</p> | |
| </article> | |
| {% endif%} <!-- end of every post that has portfolio: true --> | |
| {% endfor %} <!-- end of the loop --> |