Aside
Updated on
Last site update: 8 May 2024
Here is some code from the side bar.
1<aside>
2 <div>
3 <div>
4 <h3>LATEST POSTS</h3>
5 </div>
6 <div>
7 <ul>
8 {{ range first 12 (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }}
9 <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
10 {{ end }}
11 </ul>
12 </div>
13 </div>
14</aside>
And this is in the config.toml
1[params]
2 mainSections = ["posts", "code", "duck"]
This defines which posts will appear in the sidebar as can be seen in the above code. This makes it easy to include or remove a section from the latest posts.