mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Switch to go-toml v2
We have been using `go-toml` for language files only. This commit makes it the only TOML library. It's spec compliant and very fast. A benchark building a site with 200 pages with TOML front matter: ```bash name old time/op new time/op delta SiteNew/Regular_TOML_front_matter-16 48.5ms ± 1% 47.1ms ± 1% -2.85% (p=0.029 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_TOML_front_matter-16 16.9MB ± 0% 16.7MB ± 0% -1.56% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_TOML_front_matter-16 302k ± 0% 296k ± 0% -2.20% (p=0.029 n=4+4) ``` Note that the front matter unmarshaling is only a small part of building a site, so the above is very good. Fixes #8801
This commit is contained in:
@@ -287,13 +287,13 @@ name = "menu-theme"
|
||||
"pl1": "p1-en-main",
|
||||
},
|
||||
"menus": maps.Params{
|
||||
"main": []map[string]interface{}{
|
||||
{
|
||||
"main": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-lang-en-main",
|
||||
},
|
||||
},
|
||||
"theme": []map[string]interface{}{
|
||||
{
|
||||
"theme": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-lang-en-theme",
|
||||
},
|
||||
},
|
||||
@@ -307,18 +307,18 @@ name = "menu-theme"
|
||||
"pl2": "p2-nb-theme",
|
||||
},
|
||||
"menus": maps.Params{
|
||||
"main": []map[string]interface{}{
|
||||
{
|
||||
"main": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-lang-nb-main",
|
||||
},
|
||||
},
|
||||
"theme": []map[string]interface{}{
|
||||
{
|
||||
"theme": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-lang-nb-theme",
|
||||
},
|
||||
},
|
||||
"top": []map[string]interface{}{
|
||||
{
|
||||
"top": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-lang-nb-top",
|
||||
},
|
||||
},
|
||||
@@ -393,8 +393,8 @@ name = "menu-theme"
|
||||
"en": maps.Params{
|
||||
"languagename": "English",
|
||||
"menus": maps.Params{
|
||||
"main": []map[string]interface{}{
|
||||
{
|
||||
"main": []interface{}{
|
||||
map[string]interface{}{
|
||||
"name": "menu-theme",
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user