-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
When publishing a draft, all the front-matter configuration is overwritten to defaults #5155
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
The front-matter configuration should be kept by the following code: Line 340 in cb19b29
It's strange that the tags are overwritten to defaults... |
Do you mean you weren't able to reproduce or you can reproduce but don't know why it's happening? |
This comment was marked as off-topic.
This comment was marked as off-topic.
@neverbot I cannot reproduce. The source code of Hexo also suggests that the front-matter should not be overwritten. |
cannot reproduce |
Reproduced just now with a fresh installation of hexo without any other plugin or theme. Just install hexo, edit the scaffolds, create a draft and publish it. Maybe it was not well explained (my bad), when I mentioned "default" values, I mean what you specify in the scaffolds:
After creating the draft, edit the tags to
or
It will not preserve the I think what should be expected is the tags added in the post scaffold and the tags added in the edited draft to be... maybe merged on publish? |
Lines 302 to 309 in 725422a
maybe keys like tag and author that are not wrapped in {{}} in the scaffold should be merged after parsing the front-matter🤔
|
Check List
Please check followings before submitting a new issue.
hexo version
to check)Expected behavior
When publishing a draft, if the draft have some front-matter configuration specified, the published post should keep it. Or at least it will make more sense to me. Maybe not the date, I guess.
Actual behavior
When publishing a draft, all the front-matter post configuration is overwritten to defaults. i.e. tags/categories are removed and only the default ones are set.
How to reproduce?
The created draft should have the defaults, in my case:
Edit it, modifying tags:
Publish it:
The published post has the default values again (content of the post is ok, of course):
Is the problem still there under "Safe mode"?
Yes.
Environment & Settings
Node.js & npm version(
node -v && npm -v
)$ node -v && npm -v v16.17.1 8.15.0
Hexo and Plugin version(
npm ls --depth 0
)Others
The text was updated successfully, but these errors were encountered: