# Hugo new command scrambles front matter

**URL:** <https://discourse.gohugo.io/t/hugo-new-command-scrambles-front-matter/4682>\
**Category:** support\
**Created:** [November 28, 2016, 8:59am UTC](https://discourse.gohugo.io/t/hugo-new-command-scrambles-front-matter/4682 "2016-11-28T08:59:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shannon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/shannon/32/8158_2.png) [@Shannon](https://discourse.gohugo.io/u/Shannon)\
**Post date:** [November 28, 2016, 8:59am UTC](https://discourse.gohugo.io/t/hugo-new-command-scrambles-front-matter/4682/1 "2016-11-28T08:59:51Z")

</div>

I spent some time working out a good set of archetypes, with menu entries placed last.  
However, "hugo new " scrambles the order of the fields badly.

For example, I have a review archetype:

+++  
tags = [“review”, “opinion”]  
categories = [“reviews”]  
type = “page”  
[menu.main]  
weight = 99  
name = "menu name"  
parent=“parentid”  
+++

If I run “hugo new page/writing/new\_story.md” and then look at the file, it looks like this:

+++

categories  
= [“reviews”,]  
parent = "parentid’  
[menu.main]  
type = "page"  
tags = [“review”, “opinion”]

+++

Sometimes it is worse.

Any ideas?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 28, 2016, 9:44am UTC](https://discourse.gohugo.io/t/hugo-new-command-scrambles-front-matter/4682/2 "2016-11-28T09:44:45Z")

</div>

This doesn’t look good and thanks for reporting … We will fix this, but your current workaround is to use YAML (or JSON) front matter.

[https://github.com/spf13/hugo/issues/2745](https://github.com/spf13/hugo/issues/2745)

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 28, 2016, 2:04pm UTC](https://discourse.gohugo.io/t/hugo-new-command-scrambles-front-matter/4682/3 "2016-11-28T14:04:47Z")

</div>

Note that if you are running Hugo 0.17, it may be worth it to test the latest development version. I haven’t checked, but there have been some related TOML fixes.
