Fixing the blog: my winning combination

If you’re a regular reader of this blog, you’ve probably noticed the problems I’ve been getting recently when I insert code snippets in my posts:

image

When I write technical posts, I use Windows Live Writer because it’s free and it has lots of plugins. To be honest, it simply rocks! Now, I’ve used several formatting plugins in these last couple of years without any problems until now. However, I must confess that I haven’t really played a lot of attention to the plugins I’ve used in the past and since I tend to format my machine often, that means I typically won’t end using the same plugin again.

After looking more carefully at the HTML shown in the blog, it’s easy to see what’s going on: it seems like something is happening between the time I hit the publish button and the time the post gets published in my site. By all means, we’re not talking about magic here Smile What’s happening is that WordPress is stripping my style tags from within the post’s body. Even though embedding the stylesheet is normally an option for many of the available formatting plugins, the truth is that Code snippet and Insert Code plugins I installed kept generating style tags for setting the styles of the code snippets (which, as you can see from the previous picture, ended up being discarded by WordPress). Since I can’t access the source code of my blog (it’s kindly being hosted by msmvps.com), I couldn’t try one of the available fixes. That left me with one option (in order to keep using WordPress for my blog, that is): I had to keep looking for a plugin for code insertions that played well with WordPress.

And sure enough, after some time I’ve managed to find my old and faithful Paste as Visual Studio Plugin which inserts the styles in the tags instead of inserting style tags. And that, my friends, makes me a happy person. And it also makes my readers happy because they can finally read the code I’ve written. Overall, it’s a win-win situation. Having solved this problem, I’ve also played a little bit with VS color schemes so that the code snippets play well with the blog theme. This wasn’t easy because 1.) I’m not a designer and 2.) I really like the black layout IDE (though I must confess that it doesn’t really helps when reading technical blogs). Anyways, I’ve ended up downloading the Clean Metro style and I really think the end result was not bad. what are you thoughts on this? Do you think the blog is readable now? Can I go  back and focus on content again?

Advertisements

~ by Luis Abreu on November 12, 2012.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: