Closed Sadmansamee closed 4 years ago
Replace the contents of file layouts/index.html
with:
{{ define "main" }}
<main id="main">
<h1>{{ .Title }}</h1>
<ul class="patterns-list">
{{ $pages := where site.RegularPages "Section" "==" "post" }}
{{ range $pages.ByPublishDate.Reverse }}
<li>
<h2>
<a href="{{ .Permalink }}">
<svg class="bookmark" aria-hidden="true" viewBox="0 0 40 50" focusable="false">
<use xlink:href="#bookmark"></use>
</svg>
{{ .Title }}
</a>
</h2>
</li>
{{ end }}
</ul>
</main>
{{ end }}
Thanks, it worked wonderfully.
I want to show all the posts on Home instead of _index.md contents so that whenever website loads it will show all the blog posts. How would I do that?