Best practices / ideas for front matter metadata

I’m in the very early stages of designing a site for an architectural firm.

I’m not quite sure what would best practice or strategy for dealing with the front matter for each project. Because it needs to list fairly simple and common data across like:

+++
title = "Project title"
draft = true

typologies = [ "typo1", "typo2" ]
architect = [ "Architect1", "Architect2 ]
client = "The Client"
status = "Built"
date = 2017-11-28T07:20:30+01:00
city = "City"
country = "Country"
coordinates = [51.000000, 8.000000]

cover_image = "/images/1.jpg"
gallery = [
    "/images/2.jpg/",
    "/images/4.jpg/",
    "/images/5.jpg/"
]
+++

But then there is only a bunch of other data that may or may not be relevant to each project, like a consultant, landscape architects, awards etc.

In my head right now it is about 10-15 data points.

My questions is how to go about this. Is there a good clean way of doing something like this?

Because just adding them with a blank value in the archetypes front matter doesn’t seem like a very elegant solution - it is even discouraged in TOML. And it would make the front matter messy.

I hope my question make sense.

Any links to useful resources or discussions is appreciated. Thanks.

If the data is common for various content files that are organized under -let’s say- a section, you could include these parameters in a data file and then render them in your single.html template under a condition like:

{{ if eq .Section "section-name" }}
<---Data Parameters--->
{{ end }}

The Hugo Docs repository is a fairly complex example with lots of metadata. I wasn’t one of the architects of that site, but we generally use empty fields for common metadata.

I, personally, go back and forth on this issue. I’ll leave them out sometimes and use {{ with .Params.whatever }}{{ . }}{{ end }} to handle optional params. Other times, I’ll include them all just as a reminder of what all options are available since I will generally forget what they are unless I’m updating a site often.

Thanks. I will browse through the docs.

I don’t have a problem with empty fields. It helps make sure your documents are consistent.