0
[params]
    description = "A website built through Hugo and blogdown."

    # options for highlight.js (version, additional languages, and theme)
    highlightjsVersion = "9.12.0"
    highlightjsCDN = "//cdnjs.cloudflare.com/ajax/libs"
    highlightjsLang = ["r", "yaml"]
    highlightjsTheme = "github"

    MathJaxCDN = "//cdnjs.cloudflare.com/ajax/libs"
    MathJaxVersion = "2.7.5"

    [params.logo]  # why is this indented?
    url = "logo.png"
    width = 50
    height = 50
    alt = "Logo"

默认主题的 blogdown 默认config.toml文件的尾端如上所示。hugo-lithium我对[params.logo]表格的缩进感到困惑,距离文件末尾的五行。

这个[params.logo]表不应该是非缩进的吗?为什么要缩进这张[params.logo]表?是因为它是一个子集,并且属于[params]表格的保护伞吗?

我在blogdown的书中找不到解释,尽管它可能在那里但我错过了。我无法想象默认文件是错误的。

[params]
    description = "A website built through Hugo and blogdown."

    # options for highlight.js (version, additional languages, and theme)
    highlightjsVersion = "9.12.0"
    highlightjsCDN = "//cdnjs.cloudflare.com/ajax/libs"
    highlightjsLang = ["r", "yaml"]
    highlightjsTheme = "github"

    MathJaxCDN = "//cdnjs.cloudflare.com/ajax/libs"
    MathJaxVersion = "2.7.5"

[params.logo]  # shouldn't it be non-indented?
    url = "logo.png"
    width = 50
    height = 50
    alt = "Logo"
4

1 回答 1

1

缩进无关紧要 - 请参阅toml 规范

在这种情况下,它作为读者的视觉线索是有意义的。params.logo是“低于”参数 - 键logo被分配一个表作为值。

于 2018-12-14T19:41:13.917 回答