Closed rahil471 closed 1 year ago
You could do so via hexo render
command, however, a new post may also affect the archive, category, rss, tag, and index pages. Therefore, the hexo generate
will help to handle all these relations.
Yes correct and that's why the render command does not suits my needs, also it does not apply the theme, only does a plain html conversion.
I got your idea. I thought renderer would apply the theme.
Great Thanks! Would be great if you could provide me some pointers, I'll send a PR once done.
Glad you would like to contribute. I think you could start with the ConsoleRender. Probably add a flag to make it render with themes. https://github.com/hexojs/hexo/blob/master/lib/plugins/console/render.js
Cool, thanks!
Moreover, you also could take a look at how generate command rendering a post.
Great that helps!
Hey There, I'm half way through it.
Got a question.
view.render
function takes in locals as a parameter, but in our case we only need to render a single file from the cli. So what should that parameter be set to?
I think it should set to the path and file data. https://github.com/hexojs/hexo/blob/4676ca23734884df87501a38bb16d7a64c582111/lib/hexo/index.js#L350-L354
Can we only generate/deploy single file? Eg: