~drscream

Switch from wordpress to jekyll

Some month ago I decided I should blog more about the new fancy SmartOS we using. But than I get stuck because I hated my old and outdated wordpress setup. Maybe also the design should be a little bit rewritten … so what todo?!

So I ended up looking for an alternative solution, maybe something with static content. I checked out jekyll and pelican and I’m not sure why I selected jekyll.

The next thing was to get all data from the wordpress and put it into some markdown code. The import system from jekyll didn’t worked so good so I switched to exitwp. That have done a great job and presented me a nice list with all my posts as markdown files.

Redesign of my side was done in one day, maybe two because of all the old html mess. I only changed the font-size and font-family a little to get a better output.

What should be done with the comments from the old system? Deleted? Migrated to disqus? But what if disqus get acquired by Facebook or some other company that shouldn’t own my content? I decided to migrate the comments to static yaml files and put it on the blog again. Now the tricky part for you - if you like to send a comment to an post mail me :-)

If you already switched to jekyll and like to know which plugins I use here is a list:

I also created a Makefile to manage jekyll a little bit better.

REMOTE ?= "tm@frubar:~/htdocs"
TOPIC  ?= "New-Post"
DATE   ?= "$(shell date --rfc-3339='seconds')"
FILE    = "$(shell echo "+./_drafts/$(TOPIC).md" | sed -e y/\ /-/ | tr A-Z a-z)"

help:
	@echo 'Makefile for a jekyll web site                                        '
	@echo '                                                                      '
	@echo 'Usage:                                                                '
	@echo '    make new                  create new blog entry based on template '
	@echo '    make clean                             remove the generated files '
	@echo '    make build                              (re)generate the web site '
	@echo '    make push                       upload the web site via rsync+ssh '
	@echo '    make deploy                    generate using production settings '
	@echo '    make serve                    serve site at http://localhost:8000 '
	@echo '                                                                      '
	@echo 'Variables:                                                            '
	@echo '    REMOTE=$(REMOTE)                                                  '
	@echo '    TOPIC=$(TOPIC)                                                    '
	@echo '    DATE=$(DATE)                                                      '
	@echo '    FILE=$(FILE)                                                      '
	@echo '                                                                      '

new:
	echo "---"              >> $(FILE)
	echo "title: $(TOPIC)"  >> $(FILE)
	echo "layout: post"     >> $(FILE)
	echo "date: $(DATE)"    >> $(FILE)
	echo "published: false" >> $(FILE)
	echo "---"              >> $(FILE)

clean:
	rm -r _site/*

build:
	jekyll build

push:
	rsync --archive --compress --delete _site/* $(REMOTE)

deploy: build push

serve:
	jekyll serve --drafts --watch

Back again :-)


Send your comment by mail.