Create a blog in nodejs using Hexo


Installation of Hexo

cd blognodejs/ npm install
hexo server --draft --open
  • — draft allows displaying drafts (because they are hidden by default)
  • — open launches browser and opens http://localhost:4000 when the server is ready
hexo server -p 4500 INFO Start processing INFO Hexo is running at http://localhost:4500 . Press Ctrl+C to stop.
INFO Start processing Date Title Path 2019-06-21 About me about/ 2019-06-21 Bonjour 2019-06-21 Bonjour Miary hello/

A little sneak peeks at the blog.

touch source/_data/menu.yml
Accueil: / Photos: /photos/ Articles: /archives/
  • Left (of the “:”): the menu title
  • Right (from “:”): Destination URL


  • hexo-browsersync
  • hexo-lazyload-image
  • hexo-wordcount


npm install hexo-browsersync --save


npm install hexo-lazyload-image --save
lazyload: enable: true onlypost: false loadingImg: # eg ./images/loading.gif


npm install hexo-wordcount --save


npm install hexo-deployer-git --save
deploy: type: git repo: branch: prod message: # messg laisser vide - par défaut "Site updated: {{ now('YYYY-MM-DD HH:mm:ss') }}"
hexo clean && hexo deploy
INFO Deleted database. INFO Deleted public folder. INFO Start processing INFO Files loaded in 575 ms INFO Generated: index.html INFO Generated: archives/index.html ... INFO 17 files generated in 1.39 s

* Bonus

Write in Markdown

Markdown Plugins

  • Markdown Navigator : Markdown editor more complete than the default editor offered by the software. Additional toolbars allow you to: add links, tables, bulleted lists…
  • Paste Image To Markdown Allows to add a copied image and save this image in a specific folder.

Bookmarks and Webography



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store