Thursday, November 11, 2010

Hosting Files for Blogger

In my latest Post, I wanted to publish some simple code-examples and of course I didn't want it to be shown just as text but with some fancy syntax highlighting and copy/paste-able (this works if you double-click on the code, than you get the plaintext-version to copy). Therefore I needed to make some CSS and JS Files available for the blog and my first thought was, just to put them on my little home-server and make them public. On second thought this was not the best idea: my server often has outages and is usually under high load, so to serve the files from there might become a problem somewhen and I tried to find another solution. For Images, Videos and other Content, this is usually not a problem: Blogger allows you to use your picasa, flickr and other applications for storing and publishing this kind of content. Whereas its not possible to upload data like CSS and JS to this services. After doing some research and avoiding "Free Hosters", I found something which seems to be the solution for this problem: Having a Blogger-Account makes you actually already having a Google-Docs login as well. Last time I tried out this Google-Docs it was only designed to host documents like text, pdf and spreadsheeds: but this changed in my absence :). I was actually able to upload CSS and JS files on there and make them public available. The only disadvatage of this solution is, that you have to be aware for the link under which those files are stored internally. There is no friendly URL and you have to find out the location by trying to download the file again. So for example a file named shThemeMidnight.css will become available as https://docs.google.com/a/pfandl.name/uc?id=0B3bzvFZb7KYYNzdkMDAzMjctZTIxYS00YjBmLTk0ODItZGIyYWNjZThiZDcx Note: I'm using GoogleApps so the link for you will look very different Knowing that, I did all the adaptions on the blog and now it's able to show you the pretty code I create as it should be, without being depended on another service than google's :)

No comments:

Post a Comment