Create a blog in nodejs using Hexo

Prerequisites

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/me.md 2019-06-21 Bonjour bonjour.md 2019-06-21 Bonjour Miary hello/miary.md

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

Plugins

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

hexo-browsersync

npm install hexo-browsersync --save

hexo-lazyload-image

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

hexo-wordcount

npm install hexo-wordcount --save

Deployment

npm install hexo-deployer-git --save
deploy: type: git repo: git@gitlab.com:miary/hexo.git 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