hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Improve front matter config for taxonomies

Open bep opened this issue 1 year ago • 0 comments

I'm just creating this issue as a reminder that we need to also do something about the taxonomy config in front matter. Not sure we'll get to it in v.123.0, though.

Current setup:

---
tags: [ "blue", "red" ]
tags_weight = 30
---

And, commonly in the wild, the tags slice is directly accessed with $tags := .Params "tags".

When splitting user defined params and Hugo page config, the above doesn't fit well into the top level, so we may do something ala:

taxonomies:
   tags: [ "blue", "red" ]
   weights:
       tags: 30

And then make sure that

  1. Old configs gets mapped into the new setup.
  2. That $tags := .Params "tags" etc. still works.

/cc @jmooring

bep avatar Jan 29 '24 13:01 bep