How to list posts on homepage in a theme with custom

Hello everyone!

I’m new to Hugo and am possibly making some obvious mistake, but after several hours of googling and searching I’m still stuck. So I really hope someone will be able to help me.

I’m using the “Hermit” theme (I know it’s unmaintained at the moment, but it works and I have not found anything similar to it that would fit me). This theme has a custom homepage with an image and a menu, but no real content. At the moment my dev site is populated with example content included with the theme while I’m setting it up.

I want to have a list of posts on the front page instead of the custom homepage. So I went and did what seemed to be the most logical thing: I took the themes\hermit\layouts_default\list.html, copied it to themes\hermit\layouts and renamed it index.html instead of the original index.

Now it shows me the list of files/folders that reside in the content folder: a link to the normal page and a link to the posts index.

If I try to use suggested solution from this post (replacing “blog” with “posts”), I get posts listed twice: first grouped by the year of posts, and then again grouped by the year of that only page that is present in the content folder root.

No other changes have been done to the theme except for this replacement of one template with another. What am I missing?

I’ll be grateful for any help. Thank you in advance.

cp themes/hermit/layouts/_default/list.html layouts/index.html

Then change this:

{{- range .Data.Pages.GroupByDate "2006" }}

To this:

{{- range (where site.RegularPages "Section" "posts").GroupByDate "2006" }}

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.