Wednesday, November 22, 2006

Tell Blogger Beta not to add line breaks to your posts

When composing posts, unless the post is short and requires no special formatting, I rarely use Blogger's post editing function. Instead, I use my favorite HTML editor, format it as I wish, then copy to Blogger (I often switch to HTML mode and copy the HTML source because I don't trust Blogger can do a perfect job handling pastes in compose mode).

However, Blogger, by default, convert every new line character to <br> (check) tag and make my paragraphs look awkward. It is OK to do that in compose mode, but Blogger do that even in HTML mode. That is bad since I already formatted everything using my HTML editor. I worked around by configuring my HTML editor not to wrap long lines, or by using some tool like HtmlTidy.

Recently, I found out that 'feature" could be turned off (I am using Blogger Beta). Just go to your blog's settings, select Format, and you'll find a combo box where you can disable the feature. Note that the description under the combo box says the setting affect both the post and the comment editing forms. That is not true. I turned it off, and that affects the posts only, not the comments. That is reasonable since we rarely write a long comment with special formatting needs.

Add Kick it icon to Blogger Beta

When surfing blogs, I see many people add a list of social bookmarking links to the end of each post. I also want to add such links, and a quick search lead me to [links] where I can find the information I need. I started with del.ico.us, Digg, and Reddit, as I saw them in many blogs. Hmm... got a hunch that no-one would ever click on those links, so I decided to add some programming-related sites. dzone seems good, but I did not see much .NET-related stuff on that site. DotNetKicks appeared much better suit the contents of my blog. Finally, I picked DotNetKicks, dzone, Digg, and del.ico.us.

However, after trying submitting one of my post to DotNetKicks and seeing that many people Kick that post on DotNetKicks, I think it would be better to have my post to DotNetKicks and seeing that many people Kick this post on DotNetKicks icon rather than text link. That is as easy as following:

<a href='http://www.dotnetkicks.com/kick?url=[URL]'
 target='_blank'
 title='Kick it on DotNetKicks'
 style='vertical-align:middle'><img
 src= '"http://dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=[URL]'
 alt="Kick it on DotNetKicks"
 style="border:0; padding:0"/></a>

Replace [URL] with the permanent link to your post.

The HTML snippet for the "share this post" line as you see at the end of my posts is like this:

<!-- Social bookmarking -->
<p class='post-footer-line post-footer-line-1'>
 <span>Share this post:&#160;</span>
 <a expr:href= '"http://www.dotnetkicks.com/kick?url=" + data:post.url'
 target='_blank' title='Kick it on DotNetKicks'
 style='vertical-align:middle'><img
 expr:src= '"http://dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=" + data:post.url'
 alt="Kick it on DotNetKicks" style="border:0; padding:0"/></a>
 <span>&#160;-&#160;</span>
 <a expr:href='" http://www.dzone.com/links/add.html?url=" + data:post.url + "&amp;title=" + data:post.title'
 target='_blank' title='Vote for it on dzone'>dzone</a>
 <span>&#160;-&#160;</span>
 <a expr:href='"http://digg.com/submit?phase=2&amp;url=" + data:post.url + "&amp;title=" + data:post.title'
 target='_blank' title='Digg it!'>Digg</a>
 <span>&#160;-&#160;</span>
 <a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&amp;title=" + data:post.title'
 target='_blank' title='Bookmark to Del.icio.us'>Del.icio.us</a>
</p>

And where to put it? Suppose  you want to put it between the "posted by" line and "labels" line: search your template for "post-footer-line post-footer-line-2" and paste the snippet before that tag.