adding a social bookmarking bar to typo

time to adapt my social bookmarking toolbar, as used on my work blog, for typo. i did actually find an existing blog article about making one of these as a custom view. but, buggered if i could get it to work; it either threw up a blank page or the dreaded 'server configuration error'.
anyway, my solution may not be as 'rails-groovy' as writing the social bookmarking toolbar as a custom view - i've just tweaked the code for my theme's views/articles/_article.html.erb file and added the necessary images into my theme's images folder - but, personally i prefer my approach; hacking the actual layout of an article inside the theme itself means this hack should be relatively future-proof, as it disnae require installing any files anywhere outside your own theme directory.
you can download the icon files and code snippet here.
[please note: this tweakage was done on my customised version of the 'scribbish' theme. if you're using a different theme then obviously your code layout and CSS filenames may vary and you'll have to use a bit of lateral thinking]
only four steps:
- place the 'linksiteicons' folder [and contents!] inside your theme's images folder
- paste the ruby code into your theme's views/articles/_article.html.erb file, after the <ul class="meta"> ... </ul> block [which adds the metatags at the end of each article]
- add the CSS code to your theme's stylesheets/content.css file.
- load and save content.css in the typo's admin theme editor and also 'empty fragment cache' and then reload your typo blog in your browser. you should now have a social bookmarks bar at the end of every post.
ruby code [goes into your theme's views/articles/_article.html.erb file]:
<a href="http://digg.com/submit?phase=2&url=<%= article.permalink_url %>&title=<%= article.title %>" rel="external"><img src="../../images/theme/linksiteicons/digg.png" width="16" height="16" alt="digg" /> digg this</a> || <a href="http://reddit.com/submit?url=<%= article.permalink_url %>&title=<%= article.title %>" rel="external"><img src="../../images/theme/linksiteicons/reddit.png" width="16" height="16" alt="reddit" /> add to reddit</a> || <a href="http://del.icio.us/post?url=<%= article.permalink_url %>&title=<%= article.title %>" rel="external"><img src="../../images/theme/linksiteicons/delicious.png" width="16" height="16" alt="delicious" /> add to del.icio.us</a> || <a href="http://technorati.com/faves?add=<%= article.permalink_url %>&title=<%= article.title %>" rel="external"><img src="../../images/theme/linksiteicons/technorati.png" width="16" height="16" alt="technorati" /> add to technorati</a> </div>
CSS code [goes into your theme's stylesheets/content.css file]:
{
padding-top:10px;
text-align:right;
font-size: 0.75em;
}
#linktoolbar img
{
margin-bottom: -4px;
}
madrasite 13 - take two!
OK - here's a slightly more sensible version of my token 'hello world' post from before.

i've just installed typo and got it up and running, so at last my website has 'gone ruby on rails'. since i've been trying to get my head round RoR - on and off - for about the past six months or more, this should give my sporadic campaign to become a rails-meister some impetus.
as far as typo goes, first impressions are mainly favourable, with a few niggles:
typo initially refused to install at all, giving me the following error:
i sorted that by installing libsqlite3:
that let typo install, but when i tried to view my site i was confronted with another error:
i noticed from my browser's address bar that typo was trying to load a mangled URL - 'www.madra.netaccounts/signup', so i suspected that there was something wrong with the apache2 config options that were given in typo's installation generated 'installer/apache20.conf.example'' file [note the 'XXXX' is substituted for the random port that mongrel runs typo on]:
ProxyPassReverse / http://madra:XXXX
i'd already had to add the '.net' onto 'madra':
ProxyPassReverse / http://madra.net:XXXX
so now i tried adding a forward slash onto each of the paths:
ProxyPassReverse / http://madra.net:XXXX/
and that did the trick.
now up and running, it was time to get a bit of 'skinning' done.

on the whole, skinning typo is a hell of a lot nicer than my previous wrestlings with wordpress and blogger templates; just 3 CSS files to edit and a default layout file. it only took me about an hour to get my site looking pretty much as i wanted it [although i've no done much tweaking with the CSS for the text yet]. one other annoyance raised its ugly head here; typo is a bit too tenacious when it comes to caching pages. there is an 'empty fragment cache' button in the admin section, which is supposed to clear the custard but, in my experience it didnae seem to do much. several times, when neither saving changes to the template CSS nor emptying the fragment cache seemed to work i had to resort to deleting the public/index.html file [which gets rebuilt whenever you reload the front page].
one other niggle i noticed here was that typo's built-in theme editor function had an annoying habit of re-introducing old crap, that i'd deleted, back into the CSS even after i'd saved the changes. i ended up remotely editing the template files with textmate, then uploading them, then opening and saving them in typo's theme editor - just so i could be guaranteed that WIWWWIG [what i'd written was what i got]. this made previewing template changes even more of a PITA than it already was. still, as i said before, at least the actual code editing was a piece of piss - [relatively] clean CSS, uncluttered by the PHP spaghetti you find in wordpress templates, or the JS soup blogger uses.
there are still a couple of glitches tho'. i cannae for the life of me get rid of the ancient first draft version of the footer on the comments page. i've deleted every cache in site and edited every template file i can lay my hands on, but typo is still insisting on using a version that must be cached in a parallel universe - coz i sure as hell cannae find it!
oh yeah - and the categories sidebar disnae seem to work, either!
...and did i mention i have to manually delete public/index.html, every time i make a change to the content? - i can see that getting very irritating before long
oh well - it'll do for today. and it's no a bad start. plenty of room for more tweakage in weeks to come.