Repository: gohugoio/hugo (language: go)

Issue:
YAML format not set in front matter
<!--
Please do not use the issue queue for questions or troubleshooting. Unless you are certain that your issue is a software defect, use the forum:

https://discourse.gohugo.io
-->

When creating new site with YAML format, `default.md` stays with TOML front matter and vice versa. I have pinpointed the problems to changes between versions v0.117.0 and v0.118.0. The comparison was done using Scoop on Windows for both `-f` and `--format` flags. Also, the same is still present in v0.129.0: creation using `--format "yaml"` does not include front matter of `archetypes\default.md` in YAML.

[comp-v0.117.0-v0.118.0-f.log](https://github.com/user-attachments/files/16310656/comp-f.log)
[comp-v0.117.0-v0.118.0--format.log](https://github.com/user-attachments/files/16310657/comp--format.log)
[v0.129.0--format.log](https://github.com/user-attachments/files/16310664/v0.129.0--format.log)

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Hugo are you using (`hugo version`)?

<pre>
$ v0.117.0
$ v0.118.0
$ v0.129.0

</pre>

### Does this issue reproduce with the latest release?

Yes.


Discussion / hints:
We reimplemented the `new site` command (I guess v0.118.0). I have checked and we now use the `--format` flag only for the config file, the rest is simple file copy. 

Fix patch:
diff --git a/create/skeletons/site/archetypes/default.md b/create/skeletons/site/archetypes/default.md
deleted file mode 100644
index c6f3fcef6e3..00000000000
--- a/create/skeletons/site/archetypes/default.md
+++ /dev/null
@@ -1,5 +0,0 @@
-+++
-title = '{{ replace .File.ContentBaseName "-" " " | title }}'
-date = {{ .Date }}
-draft = true
-+++
diff --git a/create/skeletons/skeletons.go b/create/skeletons/skeletons.go
index aec79c1496b..802b15fb09f 100644
--- a/create/skeletons/skeletons.go
+++ b/create/skeletons/skeletons.go
@@ -76,6 +76,11 @@ func CreateSite(createpath string, sourceFs afero.Fs, force bool, format string)
 		return err
 	}
 
+	err = newSiteCreateArchetype(sourceFs, createpath, format)
+	if err != nil {
+		return err
+	}
+
 	return copyFiles(createpath, sourceFs, siteFs)
 }
 
@@ -109,3 +114,19 @@ func newSiteCreateConfig(fs afero.Fs, createpath string, format string) (err err
 
 	return helpers.WriteToDisk(filepath.Join(createpath, "hugo."+format), &buf, fs)
 }
+
+func newSiteCreateArchetype(fs afero.Fs, createpath string, format string) (err error) {
+	in := map[string]any{
+		"title": "{{ replace .File.ContentBaseName \"-\" \" \" | title }}",
+		"date":  "{{ .Date }}",
+		"draft": true,
+	}
+
+	var buf bytes.Buffer
+	err = parser.InterfaceToConfig(in, metadecoders.FormatFromString(format), &buf)
+	if err != nil {
+		return err
+	}
+
+	return helpers.WriteToDisk(filepath.Join(createpath, "archetypes", "default.md"), &buf, fs)
+}


Test patch: