This is a static website hosted on Dreamhost. There's no databases that these posts are stored at. The entire site is created whenever I want to present something new using Pelican, a python-based static website generator. It's "static" because you use see at any given moment doesn't change. I think static sites grew out of the need for startups to advertise mobile apps. They basically wanted to show a link to the app store. By losing the overhead of a database, you get faster loading times and greater reliability.

This site isn't just hosted on Dreamhost, it's compiled there as well. This site lives in a git repository that automatically runs Pelican whenever I push a change, which outputs to what you see now. This way, the entire history of this site is instantly available. There's no logging in anywhere, no regular update to run, no working in a clunky UI. I've always liked rolling my own when I can help it. I like the control. It's simple. It's lean.

I store the local version in Dropbox, so it's not local at all. Whatever changes I make are represented on all my machines. And all my machines have git, so I can push from anywhere. I don't have to do it this way. Technically, as long as the remote repo exists, I can pull the site. Though I find it easier to write posts this way, since I have multiple machines (including my iPad) that I access at various times during a day. A posts can take several days to write, which means several machines, which means I need drafts synced in a cloud.

Another reason I use Dropbox is because I'm trying to use a combination of Drafts, Launch Center Pro, and Dropbox to turn my iPad into a blogging machine. So far, I've gotten as far as writing my posts on the iPad and saving them in the right format on my local repo. I haven't yet figured out how to push to the remote repo. There are solutions out there that connect to local repos, but I really want something that works through Dropbox.

I could spell out the steps involved, but frankly Geoff Gimse does it very well. The main difference is that he doesn't store his local site in Dropbox, and I do. I had a problem with one of his final steps, and it turns out he was missing an export command in his post-receive hook. Here's the correct post-receive hook:

1
2
3
4
5
6
7
8
9
#!/bin/sh
BUILDSITEDIR=/path/to/remote/git/location
OUTPUTDIR=/path/to/output/location
THEME_DIR=/path/to/theme/location
PELICAN_CMD=/home/[username]/.pyenv/versions/pelican-venv/bin/pelican
GIT_WORK_TREE=$BUILDSITEDIR
export GIT_WORK_TREE
git checkout -f
${PELICAN_CMD} ${BUILDSITEDIR}/content -s ${BUILDSITEDIR}/pelicanconf.py -t ${THEME_DIR} -o ${OUTPUTDIR}

I used to run a blog a long time ago, and kept a research blog for several years in grad school. A static site is the way to go. Say I change formats or I stop blogging or whatever, I don't want my posts to be in some wonky XML or JSON blob that I'd need to parse.

Everything is a file. And that file is everywhere.



Comments

comments powered by Disqus