Mastodon Mastodon - Hugo: index vs. _index
 logo
  • Home 
  • Tags 
  • Blog posts 
  1. Home
  2. Blog posts
  3. Hugo: index vs. _index

Hugo: index vs. _index

Posted on May 2, 2023  (Last modified on July 2, 2024) • 1 min read • 126 words
Solved   Tools: Hugo   Tools  
Solved   Tools: Hugo   Tools  
Share via
Link copied to clipboard

I renamed ./content/about.md to ./content/index.md, and poof! … all tags gone, all blog postings gone.

What?!

It makes sense, if you think about it.

index.md is a special file, which automatically marks the directory it is in as a so-called “ leaf-bundle”, which then makes all the files and directories and all directories become “irrelevant” – a leaf bundle has no children.

So, what I actually wanted to do was to rename it to _index.md, which marks ./content as what it is – a branch bundle.

Or in short: don’t put index.md files in ./content. If you want to update your home page, use _index.md.

Sources:

  • Add content and Front Matter to the Homepage (Hugo docs)
  • What is the difference between _index.md and index.md? (Hugo forums)
 Create ODT files using ZIP
Flypenguin Theme ... 
In case you want to follow me

Here are some links. The further to the right, the less active.

           
(c) Axel Bock | Powered by Hinode.
Code copied to clipboard