I would like to add on the right side of my site a list of favorite sites and channels, something like that (this sis the right side of the page):
The best I found so far is to write a Markdown file:
---
title: ""
meta: true
---
## Some sites I like
- aza
- kjhkjhkjhkj
## Some channels I like
- lmkmqslkd
- mqlskdmqlskd qsdmlq
- qmsldkqmlskdmq
and render it via
{{ os.ReadFile "content/great-sites.md" | markdownify }}
While this almost works (I cannot yet get rid of the frontmatter being parsed by markdonify
) it is a bit cumbersome because I have to style the content separately through a class instead of how I do it for the Latest posts
and All tags
sections above:
<!-- latests posts -->
<div class="pt-5">
<h2 class="text-center font-bold mb-5">Latest posts</h2>
{{ range ( where .Site.RegularPages "Type" "posts" | first 3 ) }}
<li class="pl-3" style="list-style-type: none;"><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{end}}
</div>
<!-- list of tags -->
<div>
<h2 class="text-center font-bold mb-5">All tags</h2>
<div class="ml-5">
{{ range $key, $value := .Site.Taxonomies.tags }} {{ partial "tag.html" $key }} {{ end }}
</div>
</div>
My question: is there a good way to write such a list and render it through a range
?