Ok, so I’ve finally migrated this blog from mephisto to jekyll and just want to share a couple of gotchas.
The migration itself went pretty well. I’ve used scripts posted here to dump posts (although then I noticed that there’s a mephisto converter in jekyll itself that is not mentioned in the README) and move comments to disqus.
There was one thing with URLs though. I’m using “pretty” permalink style which generates directories for each post and puts an index.html with the post itself there (like /2009/3/26/deploying-a-jekyll-generated-site/index.html) so you could have URLs without “.html” at the end (/2009/3/26/deploying-a-jekyll-generated-site/), cause I had this type of URLs in mephisto. Now apache redirects you to “/url/” if you type “/url” in this case. And for disqus “/url” and “/url/” are two different URLs and if you dumped comments with URLs without the trailing slash, they won’t be displayed. This issue with pretty URLs is now fixed.
Then another thing was how to deploy the site. I’m hosting this on a shared dreamhost account and thus it would be difficult to generate the site on the server. It doesn’t have pygments (which is used for syntax highlighting) and I was using the edge version of jekyll.
So I added the generated site (“_site” dir) to the git repo, created a clone of the repo on dreamhost, pointed the domain to the “_site” dir and added a post-update hook to the remote repo (hosted on the same account) which does “git pull” on dreamhost after every “git push” on my end:
$ cat ~/git/blog.git/hooks/post-update
#!/bin/sh
unset GIT_DIR && cd /home/eugenebolshakov/blog/ && git pull
The important thing here is “unset GIT_DIR”. post-update is called by receive-pack that sets GIT_DIR to ‘.’ and confuses “git pull”. I’ve found the hint here.
Now I can just add a post, generate the site ( I have a shortcut script for that in the repo with the params I use _config.yml works great for that), do git push and I’m all set. Nice!