Apply a frontmatter property to all files in folder

.
└── content
    ├── pages
    │   ├── home.md
    │   ├── about.md
    │   └── portfolio.md
    └── somepost.md

Inside each home.md, about.md, portfolio.md, they all have menu: main in the frontmatter.

Is there a way for hugo to regard any file in pages/ to have menu: main automatically? instead of having to add this property file by file.

You can cascade the menu, but the menu values will appear alphabetically. Add this to /pages/_index.md front matter.

cascade:
  menu: main

Thank you.

And of course, to change alphabetic order, it’s enough to use weight field in frontmatter of every individual file.

2 Likes

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