link to the header

Blog Posts


Site Update 2.1

6 September 2015

I had a talk with Martin about my new site and he gave me some very good suggestions for improvements. He pointed out that it was not possible to see that you were on my page somewhere in the header, so perhaps there should be a logo or something for clarity. I really wanted to improve on these things so this whole sunday was eaten up by this project (sorry Mikaela).

It’s really fascinating how everything is more complicated then you first think, and I suspect I will never really understand css. Anyway, I fixed a very simple logo in the great photo editing program Pixelmator and revisited the design of the header, which is now separated from the images. I also found some cool hovering animations for underlining links and a way to transform the colour of svg-files.

This all lead to kimtorberntsson.com 2.1, or what I like to refer to as “Orange is the new Black”. Hope you like it, because these small changes sure took a lot of time.

To post page


This Blog is Built Using Jekyll

6 September 2015

Ok so this might get a bit technical.

Once I finished kimtorberntsson.com 1.0 I gave up on implementing a blog there for some time. I kept my tumblr (which I rarely used at all) for the time being and moved on with life. Then I listened to an episode of the excellent Swedish programming podcast Kodsnack, where they discussed (among other interesting topics) something called static html generators. They had used it to build their site quickly and once I had heard the idea behind these generators, I became interested in using one too. Apparently Jekyll is the most commonly used generator. And this is cool: GitHub has a project called GitHub Pages, where they host sites for you for free and … wait for it … they support Jekyll.

Jekyll logo

So what is this about really? Well, the terrible, terrible thing with writing html is that it is markup and not programming, meaning that you write exactly what should be displayed. This sound reasonable, but often times you want to include similar content in several places and then you can quickly find yourself in copy hell. It gets even worse when you have several pages sharing for example a navigation panel. Since you are just copying all the time, when you find yourself wanting to add something you will have to add it in several places. Or rather, you pull your hair out, get depressed, give up and in the end keep the site as it was.

The cool thing with Jekyll is that you use some smart tools for generating the page. You can include often used html sections where you want to. You have access to for loops, if statements and similar basic programming stuff. And this actually makes all the difference, since you can easily get a setup where you only have to change your code in one place, should you want to implement something new. It gets even better, since you can actually get away from writing html at all. With Jekyll you can write your posts and pages in markdown, a really nice format for annotations originally invented by John Gruber. Remember when I complained about having to write posts within html tags? Well, that’s not happening now that I use Jekyll.

Github Pages

And it gets even better. Like I mentioned before, GitHub Pages lets you host your site at them for free, but there is actually more to it than that. You don’t actually host your html-generated site there, instead you host your Jekyll project. And when you commit changes your site is rebuilt automatically. This means that all I have to do in order to add a new blog post is to write it in markdown in my favourite editor and then just push the changes to GitHub. This is just as easy (if not easier) than writing a blog post in tumblr or WordPress, but way, way cooler and more hacksy. And since the project is hosted on Github everyone who is interested can look at my source code and use it for inspiration.

Daring Fireball

There are also some nice aspects with using a generator instead of for example a database, which could of course do the same thing and much more. Jekyll can be seen as a factory that creates static pages. That means that there will be no database calls or scripts for changing the DOM, it’s all just static pages. This means that it’s easy to understand the html and the page will load very fast. Of course there’s lots of things you can’t do with a static site, but in my case this was a perfect fit. Hope this makes sense and that you also get excited, because Jekyll is really nice.

And here are a few links I took inspiration from when building this blog:

To post page


Welcome to my Blog

5 September 2015

Hi there and welcome. One thing the old version of this site really lacked was a blog. I had been thinking about including one, but at that time I built this page using only html and css. Managing a blog like that was just way to much work. In my experience, often times you write like a maniac when you set up a new blog and then after some time it just sort of dies. Now, imagine how terrible it would be to run a blog if you had to link together the new pages with each new entry and even worse, writing the text within html-tags. I would not even have bothered to write a single post. And it really was a shame, because it sure would be nice to have your own blog, where you control everything yourself. You could have your own domain name and also be absolutely certain that no ads will be anywhere on the page. And also get away from these blog site templates that are great to get started with, but quickly become a real pain in the ass as you really try to get creative.

Jekyll Logo

Eventually I heard about Jekyll and decided to use it, since it basically solved every problem that I had. It took some time before I had time for a small programming project, but once I had I started working on adding the blog functionality to my old website, while still keeping the style and content that I had already written. I’ll write a post about how and why I used Jekyll very soon.

And right, welcome. Normally I guess you should present what your blog will be about rather then how you built it, but in some twisted sense perhaps that is all the introduction of me that you need (and being honest you all know me already)? Anyway, if I manage to keep the blog up and going (which I should, now that it looks so cool) I imagine I’ll add some photos every now and then, perhaps a review of something or just some thought or tip. There is an extra reason for doing this as you’ll find out soon if you follow this feed (see what I did there). And yes, I know that it’s a bit weird to write in English when you’re from Sweden, but I really wanted to try to go international here and you guys all know English anyway.

I tried to squeeze in everything that I think an awesome blog should have. You can comment on the posts (I use Disqus for that) if you go to their dedicated pages and there is even an rss-feed for you nerds out there who dig that.

To post page


link to previous page