i edit the content of my site with obsidian or VSCode
the problem is that i have thousands of page bundles… and all these pages are “index.md” or “_index.md”
its not that wonderful setup to search and manage all the knowledge base if all files are named the same.
i was thinking: and if Hugo could be configured to read files named like its containing folder like it was an index?:
“/my-page/my-page.md” like it was “/my-page/index.md”
“/my-page/_my-page.md” like it was “/my-page/_index.md”
wouldn’t it be fantastic?
Yeah that would be great. Except, it IS that great already.
Does the trick. You need to know, that doing it that way you will switch to
my-page.md being a single page, so the single layout will catch the content. If you want to change content you can use the
layout frontmatter and put a layout with that name into
For deeper nested structures look at
slug, that will change only the last part of the URL.
thank you David
slug a lot, already. i’ll give a try with the url rewriting
If you do this:
title = "Post 1"
date = 2021-04-04T21:21:34-07:00
draft = false
url = "/post/post-1/"
This is content/post/post-1/post-1.md
Then as davidsneighbour describes, you will be able to visit the page at
However, the template(s) used to render the page will not be able to access
b.jpg as a page resource using
.Resources.GetMatch. Page resources are only available to page bundles, and page bundles are those directories with either
_index.md files at their root.
that’s the problem… i have tons of page bundles (posts, projects , tutorials) and i want to keep media without touching the templates…
if Hugo could think that “files named as containing directory” were index.md it would be much easier