The Design for this Website
The posts themselves are written in Markdown, and are kept in the
/posts folder with the following pattern:
I prepend the date when the post was written so it can be easily sorted chronologically by publish date when listing the files from the
Then, it comes the identifier of the post, which are always
two-words. If I wrote one post a day for 50 years, this would amount to around 18000 different identifiers, so two english words are more than enough.
I use a couple of Python scripts in the
index.pygenerates the home page, according to the Markdown files which are found in the
post.pygenerates an HTML page for a single post, according to its Markdown contents and the HTML template in
posts.pylists all the posts and runs
post.pyfor each one.
sitemap.xmlso search engines can index all the posts.
All the static files intended for public consumption are put in the
This site is served with the cheapest possible Debian Linux instance. The web server is nginx and it is configured to look for HTML files be default, meaning that we don't need to append
.html needlessly to every post URL.
The post identifier, the
two-words, make up the URL of the post. More specifically, the post can be found in the canonical url
When I feel like writing something, I fire up vim and start a Markdown file on
/posts. Then I run
make to generate the HTML page for the post I've just written (through calling the Python scripts).
Finally I run
make push to rsync the changed files over to the public directory on the server. That's it.
Everything is kept in git, including the Markdown files for the posts, the scripts, the webserver configuration and the generated HTML pages.
I could do it without storing the generated HTML pages on git, but I find it usefult to run
git diff to ensure changes are as intended before i do
make push to rsync the changes over to the server.