Hexo
The beginning
Couple days ago I created a demo web app and I wanted to launch a tutorial/blog to share it, my personal blog runs on Wordpress but instead of using it I was searching for something simpler, that’s how I found this little gem that now runs this website: Hexo, “A fast, simple & powerful blog framework”
It requires NodeJS to generate the content, so if you want to give it a try you will need to install it from here:
For Mac users is best to install NVM and set it to use/run the LTS version of it.
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
- nvm install –lts
- nvm alias default 16
Basic setup
Once NodeJS is installed we can run the following sequence:
- npm install hexo-cli -g
- hexo init blog
- cd blog
- npm i
- hexo server
That’s all, you should be able to see a simple blog right away in your browser (http://localhost:4000)
There are several other templates available, but fluid seems to be the most complete and with a solid community behind it. See their documentation/guidelines:
https://fluid-dev.github.io/hexo-fluid-docs/en/start/
To get this template the simplest way is to run:
- npm i –save hexo-theme-fluid
Then to update the _config.yml file, find the “theme” param at the end and set it to theme: fluid
Following the documentation is then easy to customize.
Writing
A nice feature that I like from Hexo is that you can create articles using Markdown format, more info about that format can be found here:
https://www.markdownguide.org/basic-syntax/
That is way simpler (sometimes) than HTML or rich text, so I can focus on the content and then update a bit the format when done.
To create content or pages the CLI understand couple commands like
- hexo new page about - will create a source/about/index.md file
- hexo new article - will create a source/_posts/article.md file
- hexo generate - will convert all content into static files, then we can copy it over to a static website
- hexo deploy - will deploy to cloud providers like Github, Heroku, Netlify
Recap
I’m really glad I found this tool, it serves this blog purpose perfectly, it can even support multilanguage in the future so watch this space and give it a try as well if you need a simple blog platform.