【问题标题】:I'm trying to create a blog page with hugo it gives some annoying errors我正在尝试使用 hugo 创建一个博客页面,它给出了一些烦人的错误
【发布时间】:2021-10-17 21:49:06
【问题描述】:

这是配置文件

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

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

【问题讨论】:

    标签: powershell markdown hugo toml


    【解决方案1】:

    TLDR;从配置的 toml 中取出等号。
    附:在 [[]] 语句中它们不是等号。

    一些建议: 如果您的代码不起作用,请验证您的代码(验证)-
    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 错误,不确定语法正确”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-11
      • 2019-03-09
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 2016-09-17
      • 1970-01-01
      • 2022-01-14
      相关资源
      最近更新 更多