Over past few years I had tried various blogging platforms, say Live journal, wordpress (self hosted as well), tumblr, microsoft sharepoint etc., Everyone of these had only browser based editors. I was looking for simple text file based blogging software. I came across Jekyll. But, instead of learning it, I wondered why don't I create simple one.
- Write blog using Markdown.
- Code highlighting.
- Responsive UI.
- Tagging posts.
- List blogs by date.
- Share link over social media.
- File system : It is lowest level you can getting in to. It can be easily be part of a git repo.
- MySQL : Most of the blogging software including wordpress use this one. Nothing new or special. Required some sort of ORM.
- Elastic search : json document store with extensive search capabilities.
- Couchbase : Fast RAM cached json document store. Json documents make easy for iterative devlopment.
I was concerned about the server cost and i wanted to reduce the compute time for serving the blog files. So, decided to go for simple file based solution. Here, both source blog markdown as well as generated websites will be set of files. So, webgen has to generate set of html files from set of markdown files.
- Markdown format is the core of this static website generator. Easier to create clean html from simple text styles.
- Twitter bootstrap + jQuery: Bootstrap is one of the awesome reponsive UI library available out there and jQuery is required for few of its functionalities.
- Font-Awesome : Just love the font awesome icons over default one that comes along with bootstrap.
- Python : Moved over to python from jvm langauges, so that i can learn more by using it.
- Jinja2 : Really handy html templating library for python. Comparable to one that comes along with django
- Python Markdown package is available in python which generates html out of the markdown text.
Now, all the components are in place.
- webgen : It contained all python code required to generate the website.
- sakthipriyan.com : It contains 3 components,
- Website template - used by the jinja2 and required css/js files.
- Markdown - all blog files in markdown.
- Config - config files used for generating the website.
Following set files are generated, when webgen is run.
- Home page
- Blog pages
- Tagcloud page
- Tags page
- Calendar pages
Generate the website using the following command.
#python webgen.py [location of the config file] python webgen.py ../sakthipriyan.com/conf/local.json
Though webgen is able to generate website from markdown, it is far from perfect. Lot of things has to be done over coming months, so that it can smartly generate the website.