Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOML array not parsed #2752

Closed
stp-ip opened this issue Nov 30, 2016 · 10 comments · Fixed by #2841
Closed

TOML array not parsed #2752

stp-ip opened this issue Nov 30, 2016 · 10 comments · Fixed by #2841
Assignees
Milestone

Comments

@stp-ip
Copy link

stp-ip commented Nov 30, 2016

Within my front-matter I have the following toml:

+++
title = "$title"
joined = "2011-01-01"
img = "3.jpg"
position = "$position"
social = [
  ["fa-twitter", "#"],
  ["fa-facebook", "#"],
  ["fa-linkedin", "#"]
]
+++

Rendering {{ .Params }} returns an empty social [ ].

I retried using yaml:

---
title: "$title"
joined: "2011-01-01"
img: "3.jpg"
position: "$position"
---
social:
  -
    - "fa-twitter"
    -  "#"
  -
    - "fa-facebook"
    -  "#"
  -
    - "fa-linkedin"
    -  "#"
---

Version used: Hugo master and Hugo 0.17 were tested. Both render an empty social [ ].

@bep
Copy link
Member

bep commented Nov 30, 2016

This was fixed like in the last week -- are you really sure you have tested this with the latest Hugo? And, make sure you build Hugo with make install to make sure you get the correct dependencies.

@stp-ip
Copy link
Author

stp-ip commented Nov 30, 2016

Will definitely recheck, but I did use "go get -u + go build, which should have updated and rebuild".

@stp-ip
Copy link
Author

stp-ip commented Nov 30, 2016

Hugo Static Site Generator v0.18-DEV BuildDate: 2016-11-30T08:57:46Z

@stp-ip
Copy link
Author

stp-ip commented Nov 30, 2016

git log for the golang source: "971d1ba commands: Add noChmod option to disable perm sync"

@bep
Copy link
Member

bep commented Nov 30, 2016

That is sadly not a proof since the fix was in the go-toml library. We use govendor to do vendoring, and I must admit that I'm no expert here ... But the makefile should help out.

@stp-ip
Copy link
Author

stp-ip commented Nov 30, 2016

Triple checked. Updated go vendor, updated deps, rebuild. Using make and without. Toml still comes up empty.

@stp-ip
Copy link
Author

stp-ip commented Nov 30, 2016

Might this be an issue with using arrays within arrays? It seems with the right syntax on both yaml and toml, both return an empty array.

@bep
Copy link
Member

bep commented Nov 30, 2016

You are right, Hugo does something weird in this case.

@bep bep added the Bug label Nov 30, 2016
@bep bep changed the title Toml array not parsed TOML array not parsed Dec 1, 2016
@moorereason moorereason added this to the v0.18.1 milestone Dec 28, 2016
@moorereason moorereason self-assigned this Dec 28, 2016
@bep
Copy link
Member

bep commented Dec 28, 2016

@moorereason I'm pretty sure this is not a 0.18 regression.

@bep bep modified the milestones: v0.19, v0.18.1 Dec 28, 2016
moorereason added a commit to moorereason/hugo that referenced this issue Jan 6, 2017
@bep bep closed this as completed in #2841 Jan 6, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants