Toml: Ask how these json are converted toml

Created on 19 Apr 2021  路  8Comments  路  Source: toml-lang/toml

module.exports = {
head: [
['link', { rel: 'icon', href: '/logo.png' }]
]
}

Most helpful comment

https://github.com/vuejs/vuepress is probably the right place.

All 8 comments

[module.exports]
head = [
    ['link', { rel = 'icon', href = '/logo.png' }]
]

鍥剧墖

Arrays were homogeneous in earlier versions of toml, so it appears the VSCode plugin you're using is not up-to-date since it's expecting the array to only contain strings based on the type of the first element. You'd have to change the inner array to an inline table instead:

[module.exports]
head = [
    { link = { rel = 'icon', href = '/logo.png' } }
]

(or update your plugin)

Even Better TOML advertises support for TOML 1.0.0.

OK, you originally asked a pretty academic language question, and I answered on that basis, but this isn't the place for general tech support unrelated to TOML. This is an issue you're having with vuepress and is well out of scope for a TOML _language_ issue. Perhaps you should find whatever passes for vuepress tech support or discussion boards and ask there.

https://github.com/vuejs/vuepress is probably the right place.

Thank you, I've found a solution, the code is as follows:

[[head."link"]]
  rel = "icon"
  href = "./favicon.ico"
  type = "image/x-icon"
[[head."link"]]
  rel = "shortcut icon"
  href = "./favicon.ico"
  type = "image/x-icon"
Was this page helpful?
0 / 5 - 0 ratings

Related issues

LongTengDao picture LongTengDao  路  4Comments

jakwings picture jakwings  路  3Comments

LongTengDao picture LongTengDao  路  3Comments

emilmelnikov picture emilmelnikov  路  4Comments

Silentdoer picture Silentdoer  路  4Comments