OK. For this theme I got it, it was a bit oddly documented:
# dir name of your blog content (default is `content/posts`).
# the list of set content will show up on your index page (baseurl).
contentTypeName = "posts"
The theme is written for blogs, and the behavior is clearly documented in its readme. If you don’t want that, set up a home page template as home.html in your layout directory (not the theme ones!).
As long as there’s no home.html available, Hugo will use the list template.
Also, the theme seems to be using the old (pre 0.146) template system. The theme author might want to update it, or you might want to think about using another theme (or writing one yourself).
I can’t tell you anything about themes. Wrote my own, and that’s what I suggest in general to Hugo newbies.
First, you learn your way around Hugo, and second, you get exactly what you want. Nothing missing, and certainly not a lot of stuff that you’ll never need.
If you click on a theme in Hugo’s collection, you’ll get a “last modified date”. That might be an indicator. Also, if the theme uses a _partials directory instead of partials, it should work with Hugo 0.146 and later.
You are using a theme. In other words: a website designed in created by somebody else, and made available to you for free. The chance that such a theme has a list of posts on the homepage is high. The chance of that being configurable (within the theme) is low.
However… you should know that Hugo is perfectly capable of showing whatever you like on your homepage. It is an SSG that (without a theme) allows you to create any webpage and any design. This is done by creating a homepage layout (home.html in layouts).
This is a forum where you can get answers on Hugo questions (like: how to create a different layout for home?). If you have a theme related question, you will have a higher chance of getting an answer when you ask that question to the specific theme author.
Hope this helps you ask the right question to the right person!
OK. I got confused between home.html and index.html but adding a script redirect in home.html works.
But using javascript to do this is not an ideal solution. I would also like not to copy-paste one of the list templates into this home in its entirety if possible. Is there a clean way to change the default behaviour of Hugo?
yes, usually the wrong approach to change display of the target site.
There is no Hugo default here.
Abstract view
Hugo (SSG):
“Compiles” your sources, (config, Markdown, JS, css…, layouts, partials to a target (a website).
Theme:
set of sources, merged together with all your other sources
and with HUGO, you may change the behavior or that foreign sources…
results in
If you just use content and the rest from outside - you have to take what they can. maybe set some config options if documented.
If you want to Customize more you need to write “sources”. Overwriting the foreign code is the default mechanism in Hugo to change things where the foreign code does not do what you want
So it doesn’t really work. The redirect would work sometimes and some other times it doesn’t. Is it possible to get debug logs here of what is being loaded through hugo server?
That’s weird though that if most teams would default to showing my most recent list of pages instead of my posts. I have two folders content/pages and content/posts. Why would it show content exclusively from one but not the other?
I’ll do a test removing the pages folder entirely to see if that makes a difference, because it would have to pull content from somewhere.
The theme uses the old template system, so to be on the safe side use Hugo v0.145.0 with it.
copy theme/layouts/_default/list.html to your layouts/_default/index.html
adjust the copy to your needs. to remove the list of pages replace lines 19-38 with your own stuff you want to display.
be aware, that the theme follows it’s way how to organize the stuff, so you will have to do it in the “themes way” for a smooth experience. Same for pages vs posts
This discussion about general things and expectations without really knowing what you have and what you want and what you know won’t get us to any kind of solution.
Please let me cite from the requesting help mentioned before.
Some Knowledge Required
Ok, got it, how do I get help
General thread mechanics
Let us see your code
I’m guessing it’s going to be a pain to update this theme to the new template system? It’s been one of the few themes that checks most of my boxes.
I’m also not sure how to audit other themes on my shortlist.
I got rid of my pages and then it shows posts cleanly on the frontpage. I guess this is going to be the same for other themes as well, so there’s some kind of magic happening inside there that I’m not aware of.
I get that. My questions will only be around general issues here.
I’ve read a bunch of documentation and I’m well versed in these kind of systems in general.