Single File, Generate/ Deploy
Can we only generate/deploy single file? Eg:
- I run hexo deploy/generate once. (This renders everything)
- Now I'm only modifying a single _posts (creating a new article or editing it).
- Now instead of having me to do hexo generate again it would be great if I could just place that new/edited article.
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.
https://hexo.io/docs/commands.html#render
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.
https://github.com/hexojs/hexo/blob/4676ca23734884df87501a38bb16d7a64c582111/lib/hexo/index.js#L382-L390
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