When I decided to write this tech blog, I had to choose for a blog framework…

Let’s choose a blog framework ?

Let’s write my own blog framework !

That’s not an option… Or a very poor choice.
Don’t reinvent the whell.
Many people have already done it and maybe better than what I would do.

Let’s choose “popular” blogs then !

With “popular” blogs, I mean big blogs/CMS like Drupal, Wordpress, Joomla, …
That’s maybe an interesting choice when you want plenty of features and get headaches on those mammoths !
Not for me. I hate all of these and for sure that’s not the good choice for a simple techie blog.
Wordpress ? Drupal ? RUN !!

What’s left then ?

When you don’t to write your own blog framework or use the “popular” ones, you have to look for less known frameworks.
They may not be as popular but they are perfectly suited for my need : simple, responsive and nice to handle frameworks.

What I want is something easy and kind of “plug ‘n play”.

What’s easier than focusing on writing and everthing comes in place by magic ?
Something like… let’s say… Markdown and static HTML pages generation ?

Generated blog is for you !

Generated blogs do exists and luckily, I’m not alone in this world and many people already had the same need and will than I !

Very nice projects exist such as :

Jekyll is a nice project but based on ruby on rails and I don’t want a new technical dependancy. I don’t/use ruby so I’m out no this.
Hugo has the same drawback for me : build is based on Go and I dont go Go ;)
Hexo.io is based on npm and Node.js and nowadays everyone has npm and/or Node.js installed, even me !

We have a winner : Hexo.io

So let’s sum up, hexo.io :

  • A fast, simple & powerful blog framework
  • Based on markdown
  • Handles theming (templating with Jade or ejs)
  • Plugins friendly (CoffeeScript, Jade)
  • Automated deploy (Git, Heroku, Rsync, OpenShift, FTPSync, SFTP, custom…)
  • Everything is done through a single CLI (Command Line Interface) command : hexo

What about hosting ?

Any hosting service with a web server is suited since what you deploy is HTML, CSS and JS files

I have decided to use Bitbucket Pages on my free bitbucket account.

Hexo.io & Bitbucket Pages : Howto

1. Requirements

2. Install Hexo.io

Install hexo-cli :

1
$ sudo npm install -g hexo-cli

Check if hexo-cli install is ok :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ hexo -v
hexo-cli: 1.0.2
os: Linux 4.4.0-64-generic linux x64
http_parser: 2.7.0
node: 7.6.0
v8: 5.5.372.40
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
modules: 51
openssl: 1.0.2k
icu: 58.2
unicode: 9.0
cldr: 30.0.3
tz: 2016j

3. Create your project using your Bitbucket Pages account

Make sure you already created you Bitbucket Repository for hosting your blog.
How to use Bitbucket Pages

For the sake of this tutorial, let’s be clear about some datas :

  • thedigital : my Bitbucket account
  • thedigital.bitbucket.org : my Bitbucket repository for my Bitbucket Pages

Create your local project :

1
2
3
4
5
6
7
$ mkdir -p ~/www/thedigital && cd ~/www/thedigital
$ hexo init thedigital.bitbucket.org
$ cd thedigital.bitbucket.org
$ npm install

4. Test your local installation

1
2
3
$ hexo server
INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.

Open your browser and test “http://localhost:4000/“ : Hexo.io default blog should display

5. Configure your blog
official documentation : https://hexo.io/docs/configuration.html

Edit and configure your config file :

1
$ vim _config.yml

6. Configure Git deployment
official documentation : https://hexo.io/docs/deployment.html

Install Git pluin for Hexo.io :

1
$ npm install hexo-deployer-git --save

Configure your _config.yml file :

1
2
3
4
5
6
7
8
$ vim _config.yml
____ vim _config.yml ____
## edit deploy section like this :
deploy:
type: git
repo: git@bitbucket.org:thedigital/thedigital.bitbucket.org.git
branch: master

**7. Automatic page generation
official documentation : https://hexo.io/docs/generating.html

When you write, you want to see how it displays. Nothing is messier than having to generate the corresponding static page after every change…
Hexo.io provides a command that automatically generates static pages on content modification.

1
$ hexo generate --watch

8. Create your first post
official documentation : https://hexo.io/docs/writing.html

1
$ hexo new my-first-post

Check http://localhost:4000/, your post in now available.

9. Let’s go online !

1
2
$ hexo clean
$ hexo deploy

This is now online : https://thedigital.bitbucket.io/ !

10. Plenty of other features
Just check official documentation : https://hexo.io/docs/

Just a few links :


Please feel free to leave me a message below.

1
sudo shutdown -H 0 "EOF. bisous."