Hexo is a fast, simple & powerful blog framework powered by Node.js. It is developer-friendly:
- built-in Git support
- Syntax highlightinx works out of the box
- Markdown support
- Command line interface
- Easy configuration & deployment
- No need to have DB or any other external service, it all compiled to html/js/css files.
I am using it to run this blog. It is hosted in Azure. In this port I would like to describe how to deploy & run Hexo blog in Azure.
Hexo’s home page has a good Getting started guide. To create your blog powered by Hexo do the following in command line:
To write first blog post do:
It created markdown source file for the post. Edit it with with any text redactor you’d like. Personally I use haroopad.
After you finished writing your post, do:
You should be able to see your new post on http://localhost:4000/.
Go to https://portal.azure.com/, create new Web App from “Web+Mobile” section, give it some name, select rest of parameters that depend on your subscription and click Create
Open your new web application, find Deployment section & click to create new deployment configuration.
It supports deployments from multiple sources. In my example I use Local Git Repository that will be hosted on the website that I’ve just created.
Go to settings of the website to create deployment credentials
Copy Git URL, in your folder with blog, open file _config.yml and add deployment information (If you want, you may not store password in repo property, you will enter it before deployment if you’d like)
Install git deployer:
Done! Now, when you browse your website, you will see your blog. Every time you add new post, you need to run
hexo deploy. Since generated blog is jsut set of static js/html/css files, you need to save source code of your articles (md files) on some other place. Push it to your git repository.
Add these lines to config to get commenting, rss and search working (for commenting hexo is using Disqus)
To enable Google analytics, in /themes/_config.yml add your analytics identifier to