Closed thedivtagguy closed 3 years ago
Fixed. I was not using the .
correctly. Here is the code that now renders only the latest post:
{{ range first 1 (where site.RegularPages "Type" "post") }}
<div class="article-data-outer">
<div class="image-container">
<img src="{{ .Params.hero }}" class="article-image" />
</div>
<div class="article-data">
<a href="{{ .RelPermalink }}"> <h2 class="article-title">
{{ .Title }}
</h2>
</a>
<p class ="hero-excerpt">
{{ .Params.excerpt }}
</p>
<div class="article-metadata">
{{ .Date.Format "January 2, 2006" }} • {{ .ReadingTime }} min read
</div>
</div>
</div>
{{ end }}
</h1></div>
I'm trying to have a single post displayed on this half of the hero:
I've figured out how to divide the hero into two halves with flexbox , but I can't seem to be able to get the code for displaying the single, latest post right. Here is what I have:
But this just removes the hero entirely and puts
Pages (1)
in its place.How do I just display a single post on that half of the hero?