Blogger.com page hosting

Caerulea Rosa
Aug 23, 2017 · 3 min read

Some time ago, I wanted to get a free simple page hosting with my own domain and was looking at the ad-free options without ever entering my CC details anywhere.

This is a hacky way of going about saving very little money by - relatively - a lot of effort :P The original motivation was to see if it can be done, one could also simply use the App Engine, but the free quotas apply there.

I ended up using Google’s blogger.com to host a simple website. (Note : the custom domain configuration currently does not support HTTPS, but for this kind of mostly-static content hosting, you would not really care anyway. Otherwise, you are better off getting an actual server someplace else).

The Theme can accept arbitrary JS and CSS, as well as enough HTML to be usable; thus becoming a nice and simple means of hosting with a built in CMS! One still needs to cater for the rendering of the blog posts, of course.

One need merely edit the HTML of the theme, and do their full customization. Now, Google will try and inject their GA and other stuff into the page : this is done outside the theme configuration and hence cannot simply be removed from the theme .xml.

JS globals come to the rescue : with a simple hack, one can break the injected Google JS code (optionally suppress the error output for the duration of the loading), and remove the head to prevent the injection and loading of additional content. The resources linked from body will still be fetched, but their execution is blocked by the above.

An excerpt from the template

There is a sample template at https://github.com/caerulea-rosa/blogger-hosting/blob/master/blog.tmpl

A sample result : left with the changes, right without them.

With this setup, one gets a fully customizable clean blogger hosted page/app with the added value of being able to add content via the blogger interface (which potentially requires some more coding, but is outside the scope of this post).

The potential downside is, the hosted script might change, and the execution of the scripts would thus not be prevented. The flip side being, one need not necessarily care, as this is mostly a proof of concept anyway. There used to be GA calls made on page load - the prevention of which was the original motivation for this anyway.

Happy hosting!

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade