Work in progress
I’m a slow mover here, far behind the hype-curve, but this blog is currently being moved to jekyll. The following are some notes and links from this process.
Reasons to migrate:
Some usefull links i’ve found:
This is where is spent most of my time. There are automatic conversion scripts, but i still need to do a bit of manual work on every post to create nice markdown formatted posts.
The following gedit external tool script helps converting html posts to markdown posts:
#!/bin/sh
sed 's/\r//g' | \
sed 's/\[sourcecode.*\]/<pre><code>/g' | \
sed 's/\[\/sourcecode\]/<\/pre><\/code>/g' | \
sed 's/\[code.*\]/<pre><code>/g' | \
sed 's/\[\/code\]/<\/pre><\/code>/g' | \
sed 's/^$/<div\/>/g' | \
pandoc -f html -t markdown --reference-links --indented-code-classes=code
Some manual changes:
The result is much cleaner post text.
You can do code highlighting when generating the static pages using one of the markdown engines. I’ve chosen to implement it client side, leaving the generated html as clean as possible.
[Google code prettify] will determine the correct programming language so you don’t have to specify it yourself. The following javascript lines enable prettify on all pre tags:
$(document).ready(function(){
$("pre").addClass("prettyprint");
prettyPrint();
});
Automatic conversion of image links in html to markdown didn’t work as well as i hoped. The following was created for html links showing a thumbnail image and linking to a fullsize image:
[![][]][]
[![][]]: http://www.andrejkoelewijn.com/wp/wp-content/uploads/2010/03/Screenshot-1.png
I manually replaced these with the following:
[![screenshot alt text][screenshot thumbnail]][screenshot]
[screenshot]: http://www.andrejkoelewijn.com/blog/images/2010/03/Screenshot-1.png
[screenshot thumbnail]: http://www.andrejkoelewijn.com/blog/images/2010/03/Screenshot-1-320x240.png
Disqus
Keep url the same comments:true Add disqus javascript to post template
Svg animations using objects - replaced by img tag, link to html page with object Problems with html generation using kramdown
url in wordpress everything is path, no resource:
http://www.andrejkoelewijn.com/wp/2010/03/05/jee-cdi-tip-target-unreachable-identifier-resolved-to-null/
Default in jekyll, ends with html page:
http://www.andrejkoelewijn.com/blog/2013/01/03/moving-from-wordpress-to-jekyll.html
This can be configured in _config.yml
permalink: pretty
Javascript libraries are used from CDNJS
For now this weblog is still hosted on Dreamhost, i’ll look into S3 when the migration to Jekyll has been completed.
Deployment is done using rsync:
rsync --progress --compress --recursive --checksum --delete _site/ [email protected]:public_html/
Cloudflare CDN to cache all content Pagerule to host html pages: www.andrejkoelewijn.com/wp/20////
Performance result on webpagetest
To deploy to Amazon S3 the following s3cmd line can be used:
s3cmd sync --dry-run --skip-existing --delete-removed ~/Dropbox/weblog-andrej/site-src/_site/ s3://<bucket name>