Building a Blog: Overview
This post is part 1 of the "Building a Blog" series:
- Building a Blog: Overview
- Building a Blog: Generating Static Files
- Building a Blog: Authentation
- Building a Blog: Deploy
Why host a blog myself at all? The simple answer is, I need simplicity for writing(markdown) and customization.
Medium is was my choice for writing, it's simple, elegant, and there's a log of goood posts on it. But still something is not that ideal, for example it does not support markdown(as far as last time I tried), no support for math formulas, which means basically they are not intended to serve writers with math at all. So you'll find all equations in a picture.
But I need something more. I want reveal.js slides. I want authorized access by some criteria. There's no way I can get these with Medium or other platforms, yet.
I expected to finish this in a few hours, but eventually it took me days. But the pipline is infact not complex. I'll list the process with short descriptions, and leave the details in later posts. There are there major steps: 1. generating content; 2. add an authorization layer 3. host.
The first step is generating and rendering the output with inputs like markdown or rst etc. There are many solutions, you may be already familiar with jeklly, hexo, sphinx etc. I'm using pelican here.
As mentioned earlier, customization is import. At least I need special marks on some kind of posts, special rendering for slides output, and fine control over the template. With pelican I can do that.
I'd like to mark some post as confidential and only accessible to authorized visit. Obviously with static pages that's not possible. Here I used flask as an additional layer to manage accessibility.
At this point, the content is mostly ready. What remains to be done is hosing it one the net, with a bare machine.
The task is simple, but there'are many things to be prepared.
- Server users and priviliges
- nginx for reverse proxy
- use uWSGI to deploy flask application
- Use CI to triger automatic update