Fantastic presentation that I attended at #velocityconf given by Nichole Sullivan on modular CSS design and how it effects (yes, that’s right, i said effects) performance.
First posted by estherbester.
The Fast And The Fabulous
Fantastic presentation that I attended at #velocityconf given by Nichole Sullivan on modular CSS design and how it effects (yes, that’s right, i said effects) performance.
First posted by estherbester.
The Fast And The Fabulous
Those nifty buttons are a great way to make your blog a better place for your readers. ShareThis has worked pretty hard at making them easy to integrate into your site. When you sign up, you get some button code that you can plop down inside your post (like I did earlier in this paragraph), or better yet, inside your post template next to the comment button.
This is fine for a single post, but what if you want users to be able to share posts on the main page without having to click through? Just pasting the script down for each post has the negative effect of linking to your home page instead of the entry you’re trying to share! This is not so helpful later on when your post has wriggled it’s way down into the archives.
Fortunately the ShareThis API allows you to include their script in your <head></head> tag once and then add this snippet with the proper link and other info needed to share your post:
You could fill one of these out manually and put it in each post, but that would be no fun, would it? I’m a lazy guy, so I googled a bit and turned up this automatic solution, which uses prototype (a popular javascript library) to voodoo the information out of your document and into the snippet. I’m more of a jquery guy myself, and got the whole thing working using my favorite library, but it made me uneasy that this was relying on the structure of the page extract information to ShareThis. This is likely to break if you change your post layout.
To get around these problems and make it easer for non javascript hackers, I decided to use tumblr template tags (yay alliteration) to create the ShareThis snippet directly. This gives you control over what fields from tumblr go into ShareThis, and improve the quality of your outgoing links. As you look at the snippet, keep in mind that tumblr template blocks like {block:Photo}{/block:Photo} only appear if the entry is a photo, so you can customize what data you send for each type of post:
To use this script, first paste your ShareThis script <head>Inside the head section</head>, then paste the apove script wherever you want your ShareThis link to go on the individual blog post. For me, this was at the end of the posts loop:
{block:Posts}
...
<!--INSERT SCRIPT HERE-->
{/block:Posts}
Notes:
I did a fair bit of testing on the links this script produces, but it could certainly use more. Let me know how it works for you, and feel free to fork it on github.
I hope you find this useful!
Was the post too technical for you? Not technical enough?
The first things to go were all my tweets that were cluttering these pages (death by a thousand pecks?). Now my twitter status is relegated to the sidebar where it belongs.
With the everyday tweets out of the way, I kept the most insightful and interesting content (from my own perspective, of course), moved twitpic images right onto the blog, and turned the witty tweets into quotes.
For more hot sidebar action, you can see the posts that get the most views according to google analytics along with a nascent village of apple-touch-icons linking to other places you can find me on the web.
I’m excited about using the new ShareThis service to add sharing links to all my posts! It took a bit of effort to get it working with tumblr, so I’ll post instructions later to save people the hassle.
The commenting system also got an upgrade. You can now log in via your facebook or twitter account in addition to using a disqus user or posting as a guest.
Let me know what you think of the new changes! Look for a howto on the ShareThis links as well as a guest article by Erik Dreyer in the next few days.