Hi community,
I’d like to have the homepage of my blog lay at /blog/index.html
, while having all the slugs starts at /
. I first started using domain.tld/blog
as site domain in the config.toml
, but that led me to have /blog/section/post
for the posts URLs, which is not what I’m looking for.
So I removed that, and now the homepage lies at /index.html
.
Then my question is whether I can create a /blog/index.html
page that will list all posts exactly like the homepage would do, and how can I do that? Simply said, a site tree like the following:
-
domain.tld/index.html
→domain.tld/blog/index.html
for the homepage -
domain.tld/<SECTION>
for the sections -
domain.tld/<SECTION>/<POST>/
for the posts - …
I have looked through the discuss forum and found a few questions that were close:
① adding a /layouts/_default/blog/list.html
- https://discuss.gohugo.io/t/how-to-create-a-page-referencing-all-published-post/523
- https://discuss.gohugo.io/t/solved-how-to-create-multiple-pages-like-homepage/2505
- https://discuss.gohugo.io/t/how-to-add-a-list-of-content-from-another-section/2479
bot all those solutions are based on the fact that all my blog posts are in the /blog
section. So that would lead me to a tree like:
domain.tld/blog/index.html
domain.tld/blog/<SECTION>/
domain.tld/blog/<SECTION>/<POST>
which is not what I’m looking for…
② https://discuss.gohugo.io/t/question-about-creating-a-blog-link-in-hugo/3499
where it redirects to an interesting tutorial, but still it’s not answering my usecase. There it tells how to create other pages that offer content (like about page} not a simple copy of /index.html
in another path.
I’m still rather new to the way hugo works, and even though everything went very smoothly in converting my blog, that last bit, which I thought would be quite trivial, has been hurting me for a while now…
Cheers!