2

I am using Hexo.io and like it so far but I am totally baffled by the workflow.

This is what I have to do - in one terminal I run hexo server so that I can see the local site. It insist on adding a hello world post (part of the core modules) and no way to get rid of it.

Then, in order for the site to show my changes I have to, in another terminal, run hexo generate -w.

Then before I deploy I actually need to run hexo clean before running hexo deploy or hexo generate -d as it seems that when it generates after changes it only changes the served site and not the generated site.

Completely and utterly baffling. Has anyone else experienced this? I am missing some trick?

cyberwombat
  • 38,105
  • 35
  • 175
  • 251

2 Answers2

5

You just have to run hexo s to start server. If you edit/add a file(articles, layout, css, theme/**/_config.yml, etc..), Hexo detect it and regenerates automatically the new site. The only case where you need to stop and restart the server, is when you change the main _config.yml file.

hexo generate command is use to generate the blog one time.
hexo clean delete db.json file. Its useful when you have to delete useless tags and categories which are not linked to an article. To deploy your blog, run hexo clean(optional) then hexo generate --deploy

Louis Barranqueiro
  • 10,058
  • 6
  • 42
  • 52
1

server command is there for you to preview your changes, it is by design to be non-persistent.

generate on the other hand create persistent HTMLs in the file system.

To deploy, HTMLs in the file system is required so either the deployer creates a temporary copy for you or you run generate before you deploy.

leesei
  • 6,020
  • 2
  • 29
  • 51