Are the `_build` and `build` front-matter keys aliases or distinct in their functionality?

I can now only find references to the build front-matter key, but when I starting using this feature a while ago it was named _build.

With a quick search of the Hugo Docs, I’m only finding use of the _build key, such as in content/en/functions/resources/_common/_index.md:

---
_build:
  list: never
  publishResources: false
  render: never
---

Are build and _build different keys/features, or aliases, or what?

Thanks for any clarifications.

The front matter root was originally a mix of Hugo reserved keywords (e.g. title) and user defined params (e.g. foo), which made us (me) a little fearful when adding new keywords, so I used the _ prefix.

At some point we introduced the params front matter that is also used elsewhere in Hugo.

So now:

  • Both works, but _build is an alias for build.
1 Like

Thanks @bep. Would it make sense to add a note to, say, Build options, about the _build alias? If so, here’s a try at that: hugoDocs PR #2942.

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