Apply updated archetype frontmatter to existing content

Good morning,

I’ve got a content type ‘profile’ with its own archetype up and running. I’m constantly updating the archetype with new params at the moment and would like to see those new params added to existing profile content automatically.

I assumed that when an archetype was saved Hugo would rebuild all content of that type afresh using the updated archetype params. That doesn’t seem to be the case. If I make some new profile content all of my params are there ready to be filled in.

Any thoughts on how I should be tackling this? Do I need to stick to adding in those params by hand into older content? Can I ask Hugo to ‘rebuild’ my content types?

Thanks for your help in advance.

I think this is a very dangerous and unexpected thing to do. Archetypes set the fields to some default values which often need to be set to real values in each piece of content. Automatically changing existing content seems quite dangerous.

If you typically want the default value, then setting it in a template is a good way to do this.

I could see some benefit to an “apply archetypes” function which operates in the manner you’ve described but is intentional and deliberate, not automatic.

Thanks for the clarification :slight_smile:

I can understand that altering existing content could be destructive or contradictory. I’ll investigate setting the default values in a template directly instead.

The ‘apply archetypes’ function sounds useful - I completely agree that it should be a user-controlled action and not an automatic extension to --watch.