So, I got a basic site set up that iterates over all .md files in the post category. http://hugo.bitballoon.com/
It does this with the following code:
{{ partial "header.html" . }}
<main>
{{ range first 5 (where .Data.Pages "Section" "post") }}
<div class="post">
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<small>{{ .Date.Format "Mon, Jan 2, 2006" }}</small>
<p>{{ .Summary }}</p>
{{ if .Truncated }}
<div class="read-more-link">
<a href="{{ .RelPermalink }}">[ Read More ]</a>
</div>
{{ end }}
</div>
{{ end }}
</main>
{{ partial "footer.html" . }}
Now, I also have another category that will be for link posts. Link posts will only be a header that is a link to another site, so it doesn’t follow the normal post layout.
So here’s my question, how can loop through and display the latest posts from several different categories on the front page?
{{ range first 5 (where .Data.Pages "Section" "post") }}
Follow up question:
I still need to know how I can treat all posts as separate things. For example, when I post a blog post it will have a blue title, and when I post a link post it will have a red title. How would I go about doing that?