HUGO

Script to order front matter

A bit off-topic, but hopefully this question may be of interest to others as well. I have a few hundred files where I’d like to change the order of the front matter.

Example:

title = ""
description = ""
genre = ""
website = ""

I’d like to change the above to:

description = ""
genre = ""
title = ""
website""

Is there a known script or some easy way of doing this instead of manually changing each file?