Easily change order of Hugo weight

HI.
I need a help/an idea on how to approach this.

I know we can order content by weight in Hugo.
But I’m afraid that adding a new content in between of weights it is a nightmare.

Let’s say I have a site with 100 pages that ordered by weight.
What if I want to fit in a new content at weight:36.
Does it mean I have to manually edit/increment all the files above that number?

Thanks everyone, appreciate your time!

I typically set the weight to a multiple of 10 to allow future inserts.

If your weights are sequential (e.g., 1, 2, 3), you can use an editor that supports regex search/replace to add a zero to the existing values. For instance, if I use TOML in front matter, I can do this in VS Code:

1 Like

Thanks for you idea. I thinking of the same things with instead 100 increments. Appreciate it

1 Like

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