0

这是配置文件

baseURL = "https://.github.io/"
languageCode = "en-us"
title = "Title"
theme="hugo-PaperMod"
[[params=]]
    [[homeInfoParams=]]
        Title= "Hi there wave"
        Content= "Can be Info, links, about..."

    [[socialIcons=]] 
        - name= "github"
            url= "<link>"
        - name= "<platform 2>"
            url= "<link2>"

这是powershell上的错误

ERROR 2021/08/15 17:40:30 "C:\Users\user\Desktop\blog\webapp\config.toml:5:9": unmarshal failed: toml: expected character U+005D
Rebuilt in 1 ms

我是这个领域的初学者,这很可能是一个基本的东西,但我无法弄清楚。

4

1 回答 1

1

TLDR;从配置的 toml 中取出等号。
Ps 它们在 [[]] 语句中没有等号。

一些建议:如果您的代码不起作用,请验证您的代码(验证)-
https://www.toml-lint.com/
如果验证器给您错误时您不理解语言语法,请检查您的具体误解用那种语言(那个 linter 会给你更多的数据)。
https://github.com/toml-lang/toml
因为它是 hugo,他们有预先构建的配置文件供您查看,查看其他人所做的工作:
https ://gohugo.io/getting-started /configuration/#readout
https://themes.gohugo.io/

另外,在查看您的问题和更广泛的领域时:

  1. 为什么说烦人的错误?英语不是我的第一语言。但它告诉你你的 toml 写错了,所以它无法解析它。您提供的信息越准确,您从该领域的其他人那里得到的信息就越准确。
  2. 所以,一个更好的例子是(这是一个想法):“HUGO Config.toml 错误,不确定语法正确”
于 2021-08-16T04:39:36.210 回答