I’m trying to create a blog archive by year page that is a subpage of the blog index and I must be missing something b/c i can’t figure it out. Here’s what I’m working with:
Now I’m trying to create an essentially static page at the url example.com/blog/archive/ with the following content:
{{ range .Data.Pages.GroupByDate "2006" }}
<h2>{{ .Key }}</h3>
<ul id="list">
{{ range .Pages }}
{{ .Render "li"}}
{{ end }}
</ul>
{{ end }}
I’ve been able to create a page at /blog/archive/ by utilizing the front matter url: "/blog/article/" but i can then only get static text/html to be parsed any {{ … }} tags are converted to plain text. I’m wondering what the most correct way to do something like this would be.
Could have sworn i tried that but yes that works. I think I may have needed an update to (which introduced a whole bunch of other issues). Specifically here is what i needed:
{{ range (where .Site.Pages "Section" "blog").GroupByDate "2006" }}
I’m wondering about this having ‘logic in the layout’? Can you give me some hint where to look/read about it?
The reason why I’m asking is that in my sites I have a need to mostly have static content in the form of articles, blog posts etc., but also have have need to have some kind of ‘widgets’ on certain pages like calendar showing events, or e…g. download counters for multimedia (mp3) files we provide in public area section etc.
So, what to do in such scenarion when one would like to use Hugo (as static site generator) for most of the web content, but has need for some dynamic content as well which is not worth to deploy some PHP/Python-based CMS with all their usual baggage?