You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a filter on before_post_render. Previously with Hexo 6.x, I was able to add a property to the post like so:
hexo.extend.filter.register('before_post_render', function (post) {
post.has_code_block = post.raw.includes('```');
return post;
});
And then the new property, has_code_block in this case, would be usable in my templates. With Hexo 7, the new property isn't available in the templates. Modifying an existing property works as expected, though.
Actual behavior
The new property is not available within templates. Updated properties are available in templates with their updated values.
How to reproduce?
Create a filter that adds a property to the post object.
Check List
hexo version
to check)Expected behavior
I have a filter on
before_post_render
. Previously with Hexo 6.x, I was able to add a property to the post like so:And then the new property,
has_code_block
in this case, would be usable in my templates. With Hexo 7, the new property isn't available in the templates. Modifying an existing property works as expected, though.Actual behavior
The new property is not available within templates. Updated properties are available in templates with their updated values.
How to reproduce?
post
object.Is the problem still there under
Safe mode
?n/a
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)No response
Others
No response
The text was updated successfully, but these errors were encountered: