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

commands: Support human-readable YAML boolean values in undraft #3182

Merged
merged 1 commit into from Jul 3, 2017

Conversation

kropp
Copy link
Contributor

@kropp kropp commented Mar 14, 2017

Simplified version of #2831

@n10v
Copy link
Contributor

n10v commented Mar 21, 2017

Sorry for the stupid question, but how does it work, if it replaces nothing.

@kropp
Copy link
Contributor Author

kropp commented Mar 21, 2017

@BoGeM there is a loop over all frontmatter entries. Before this change, when draft key was found, it's value was changed from true to false. After this change this entry is skipped and not written to resulting frontmatter. Absent draft key means that the entry is not draft.

@n10v
Copy link
Contributor

n10v commented Mar 21, 2017

Thanks, now it's clear.
When the docs should be also edited, because initially undraft command sets undraft field from true to false. Now you just delete. It should be noticed.

@bep
Copy link
Member

bep commented Mar 21, 2017

How is yes interpreted by go-yaml?

@kropp
Copy link
Contributor Author

kropp commented Mar 21, 2017

@BoGeM thanks, nice catch! I've updated my change.

@kropp
Copy link
Contributor Author

kropp commented Mar 21, 2017

@bep all values according to spec are supported: https://github.com/go-yaml/yaml/blob/v2/resolve.go#L37-L42

@bep
Copy link
Member

bep commented Mar 21, 2017

@kropp that was not my question.

@kropp
Copy link
Contributor Author

kropp commented Mar 21, 2017

@bep yes is interpreted as true

@n10v
Copy link
Contributor

n10v commented Mar 24, 2017

Could you delete please the last line of help (If the content's draft status is 'False', nothing is done.). Your change removes the draft property despite the value.

@kropp
Copy link
Contributor Author

kropp commented Mar 26, 2017

@BoGeM No, undraft command does the check first and breaks if the given page is not draft (see https://github.com/kropp/hugo/blob/bf8aa82a5b638e88ba9529a26c7b81dfbda2e350/commands/undraft.go#L119-L122).

The documentation is therefore correct.

@n10v
Copy link
Contributor

n10v commented Apr 1, 2017

Ah ok, sorry for my inattention.
Then it looks good to me.
What do you think, @bep?

@kropp kropp force-pushed the master branch 2 times, most recently from e0f97ff to 63101e3 Compare April 18, 2017 21:17
@bep bep merged commit 1039356 into gohugoio:master Jul 3, 2017
@github-actions
Copy link

This pull request 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 Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants