Delicious irony, and MongoDB
So I guess it would stand to reason that a day after blogging about how awesome my new blog routine is, and how it helps me to post every day now, I get busy enough not to find time to really polish the draft I have going at the minute. Not wanting to lose my streak (just), I figured I’d at least try to post something useful today, even if it’s just a link to someone else.
This excellent article about MongoDB is well worth a read. I’d already used Mongo and MongoMapper a little bit on a pet project just to try it out - it powers a basic URL redirector, and runs on Heroku and the (so far excellent) MongoHQ. However after reading John’s article, I’m itching to build out something more substantial using Mongo, to take advantage of some of the really cool things that can be done using it, namely array/hash keys, and GridFS file storage.
Check out the article, then take a look at MongoDB if you haven’t already!
Blogging, and sticking to it
As some of you may have noticed - I’ve been blogging a lot more in the last few days. This is me attempting to start a New Years resolution early, and that’s to try and publish a new post everyday.
However, I always found writing a new post from scratch, checking it twice, proof reading it and publishing it all in one day very daunting. Two different things have helped me with this.
The first, is that while reading Gary Vaynerchuk’s book Crush It!, I took the tip he outlined and wrote down 50 blog post topics that I could think of straight off the bat to talk about. At first I thought 50 was a lot, but when I got going I realised there was a huge number of interesting things I could write about. In the end I wrote more than 50 topics down, and since then have been adding almost as many to the list as I have been crossing off. This means I always have a list of cool things to write about and put down in a post.
The second thing was that I’ve altered my workflow slightly. I used to sit down and try to write a post from start to finish and publish it. This too meant that it always seemed like a big task to try and write something up. However now, I try to simply write “half a post”, or rather, get my initial idea down in rough draft format, and then tidy it up, proof read it, and publish it the next day. Now this means that each day, I finish off one post by simply checking it over, making a few tweaks, and publishing it, and then put another idea down in draft format ready for the next day (if I have time, I might put a couple of drafts down).
Thanks to these two steps, it never seems like too much effort to get a post out each and every day. That, combined with how easy to use Tumblr is, means that I’m now back to writing content regularly, enjoying it, and hopefully some of you are finding it interesting too!
Advanced Tumblr Customization
As I hinted in my last post, I wanted to outline a few tips and tricks I used to customize this site pretty heavily when getting it up and running on Tumblr.
The documentation for building custom themes is pretty comprehensive, and covers the majority of things you’d want to do when building a customized site. I won’t rehash it here, needless to say it’s a relatively straightforward templating syntax that doesn’t take too long to get your head around.
One of the things that the current theme syntax does omit is to be able to identify when you are on a private post, or specifically, when you aren’t. Often you’ll want to drop in Disqus or another such script-based commenting system on all posts - except private posts, if like me you are using them as about or contact pages, you don’t really want to invite user comments for them!
The way I tackled this was to have the comments script embedded on all post pages, but to then hide it for specific pages. The easiest way to then choose to hide it on private pages, was to use the post IDs. If you wrap your comment code in a div similar to the below:
<div id="comments_{PostID}" class="comments">
You’ll then end up with something like this on the actual post:
<div id="comments_252690956" class="comments">
This then means that if you know the post IDs for the private posts (or any posts that you don’t want this to show on), then you can use CSS like the following to hide the comment form:
#comments_252690956 { display: none; }
To find the post ID for a private post, you can look at the URL. It will look something like this (this is the URL for my portfolio page):
http://ejdraper.com/private/252690956/tumblr_kthwgddWRp1qap2vc
In this case, the post ID is 252690956.
This isn’t the most ideal solution, as the comments form is still on the page but just not shown, however given the lack of a way to separate private posts from public posts within the Tumblr template syntax, for now this will have to do.
Using the same technique, I accomplished the exact same results with the pagination which I wanted on each public post, but not on private posts:
{block:PreviousPost}
<a class="pagination pagination_{PostID}" href="{PreviousPost}">
« Previous post
</a>
{/block:PreviousPost}
.pagination_252690956 { display: none; }
I used a class here to identify the pagination div, as I actually have two, one for previous post, and one for next post, and so used the same class for both.
Another little trick I had to employ, was to do with my banner image that appears only on the homepage. The syntax for identifying the index page refers to any type of index page, which also runs to both search result pages, and tag result pages. So this means that placing my header image solely within a {block:IndexPage} means it’d also show on both search and tag pages too, which I didn’t want. Seeing as how there is syntax for identifying a search page ({block:SearchPage}) and a tag page ({block:TagPage}), we can use these to specify a class that will cause the banner to be hidden in those circumstances, leaving it showing on the other remaining type of index page, the homepage. The code looks a little something like this:
{block:IndexPage}
<div id="index"
{block:SearchPage}class="hidden"{/block:SearchPage}
{block:TagPage}class="hidden"{/block:TagPage}>
<a href="/">
<h1 id="logo">Elliott J Draper, Freelance Developer</h1>
</a>
<div id="headings">
<div id="web">Web and mobile development</div>
<div id="rails">Ruby on Rails specialist</div>
<div id="deliver">I always deliver</div>
<div id="bank">And I won't break the bank</div>
</div>
<div class="clear"></div>
</div>
{/block:IndexPage}
And the CSS is real straightforward:
.hidden { display: none; }
Besides those couple of little tricks to get around some minor limitations in the theme templates, other customization is made relatively simple by the rest of the fairly powerful theme syntax. The only other thing to mention is custom text and images. To enable you to quickly edit certain bits of the theme, such as links or header text, or to upload images, you can use a special bit of syntax. For text:
{text:MyCustomText}
and for images (this puts the URL path to the image into the HTML):
{image:MyCustomImage}
If you then declare these in the head of your document as follows:
<meta name="text:MyCustomText" content="">
<meta name="image:MyCustomImage" content="">
then you’ll see these options now in the “Appearance” tab of the Customize Tumblr view. For images, there will be an upload option to specify the image, and for text you can simply enter the value you want to use. In this way, you can store headings and external links as text, so that you can easily change them, and you can store all images you need for your custom design as custom images which you upload.
Hopefully some of these tips and tweaks will be useful to others customizing sites on Tumblr - I find that on the whole the theming on Tumblr is very straightforward, and a lot of fun. With a bit of thought and planning, it’s simple to create a decent customized site and get it up and running on Tumblr.
Feathered
So it’s been two weeks since we open-sourced Feather. The feedback so far has been great, really pleasing, we’ve had some great coverage, and some great contributions. I figured I’d do an update on where we’re at, and highlight some of the cool things from the last two weeks.
So first of all, the coverage the project has gotten is great. We made it on to the brilliant “This Week In Ruby” on Antonio Cangiano’s blog, for April 28th. We also made it on to the Rails Envy podcast, another great source of the latest Ruby and Rails information, on April 30th. On top of that, after submitting the announcement post link to RubyFlow, it then made it on to Ruby Inside, in a round-up post of the best of RubyFlow for the last couple of weeks. RubyFlow seems to be a great site for the latest and greatest news in the world of Ruby, so it was brilliant to be picked in a round-up post from two weeks worth of links!
We also received numerous links from other bloggers, and there seems to be quite a buzz about the project so far, which is great!
As for the sourcecode itself, thanks to GitHub we are able to keep a great handle on the interest level, and we’ve seen that skyrocket! At the minute, we now have 95 watchers on the main codebase, and 13 people have forked the code! For the plugins codebase, we have 6 forks, with 40 watchers! And each day we have more and more people watch or fork the code.
We’ve also made some great progress with features and bug fixes. In the last couple of weeks since opening up the codebase, we’ve had:
- XHTML/styling fixes from Michael Bleigh
- custom permalink formats from Jake Good
- Mike added pagination for the admin article index, and also for the admin comment index
- Atom feed support for articles/comments from Markus Prinz
- a Mephisto importer plugin from Jake Good
- a Typo importer plugin from Marc Seeger
- a small markup fix from Bradly Feeley
- Mike also nailed a few other fixes
I think that’s most of the major contributions, apologies if I’ve missed anyone (let me know in the comments and I’ll update the list!). Considering that it’s only been open source for two weeks though, I think that’s great! We also have some other contributions in the pipeline, and so things seem to be progressing nicely. A list of contributors is also available on the GitHub wiki (thanks to Mike) here. If you’d like to see your name there, you know what to do!
To try and organize fixes, issues and feature requests, we’ve setup a Lighthouse instance for Feather. It’s available at http://feather.lighthouseapp.com. You’ll be able to add bugs or feature requests, and if you’d like to contribute by tackling any of the issues or feature requests there, let us know and we’ll give you access so that you can be assigned them so everyone knows your working on them. We’ve also setup an IRC channel to hang out and discuss Feather on irc.freenode.net (#feather). Me and Mike are in there quite a lot, so come on in to talk about Feather, whether it’s talking about how to set it up, how to extend it, or specific issues you might be having. The more the merrier!
Something else to mention is those that have switched their blogs to Feather. Obviously me and Mike are running Feather, and Jake finally got his blog over to Feather once he finished his Mephisto importer. And more recently, in the last few days Marc got his blog up and running with Feather too. They all look great, and if anyone else is using Feather, it’d be great to hear about it, so let me know!
Besides logging a few bugs, and hanging out in IRC to help people with some setup issues, I was also able to knock together a basic getting started guide this week. It’s available on the GitHub wiki for the project, here. One of our aims is to make setup easier over the next few weeks, but in the meantime at least there is a set of instructions to hopefully make it easier for people to get up and running.
Also over the next few weeks, we’ll be aiming to get an official Feather site up and running, which will include news, updates, an official plugin repository so that we can have one-click installs for plugins, and some more guides to using Feather, and developing plugins for it.
With more plugins on the way, a few bugs to fix, and some new features to put together, I’m sure the next two weeks and beyond will be just as productive for Feather. If you’re interested in getting involved, drop by #feather and introduce yourself, you’ll be more than welcome!
Announcing: Feather
So after a few weeks of teaser posts, we’ve finally opened up the code on the software that powers this very blog, Feather. It’s been a collaborative effort so far between me and my boy Mike, but now it’s time to open source it, and hopefully people besides us will not only find a use for it, but will also find new ways to extend and improve it.
So what’s in the current codebase? As alluded to before, the core itself is lightweight. Basic article posting, and user management is all you’re really getting. The beauty is in the wide variety of plugins that are (and will be) available to extend the software further. Within a separate plugins repository, there are currently twelve plugins, that extend Feather to provide comments for articles, feeds, formatters for article content (Textile and Markdown), basic RSS importing for articles and comments, integration with ping services, the ability to setup hard-coded redirects on your site, sidebar and snippet content, overridden css styles, tagging, Twitter integration (to display your tweets in line with blog posts), and file uploads. The code in core and for these plugins probably isn’t perfect, but it’s good enough to power a few blogs already - and improvement is where you come in.
If you’ve got an idea for a new plugin, improvements to existing functionality, or you’ve found a bug, then by all means fork the project on GitHub, implement your code, and send us a pull request so we can merge the changes into the main trunk. Alternatively, send us your patch via e-mail, and we’ll look to include it within the application. If you submit two patches to either feather, or feather-plugins, then you’ll be given commit access to the repository in question, and will effectively become part of the core team. So what needs doing right away?
The biggest deficiency at the minute are specs - there are some specs in the core code, but it doesn’t cover a lot of the application, and ideally we’d be aiming for 100% coverage of the core controllers and models. We then need to devise a decent way of similarly shipping specs with plugins. When we start updating and improving plugins, we’ll need a way of handling data migrations smoothly and efficiently. On top of this, there are still outstanding useful plugins that need to be written, such as content search, and trackbacks, as well as integration with services other than Twitter. Lastly, there are bound to be bugs, so roll up your sleeves and fix them, it’ll be much appreciated!
We’ll be rolling out a Feather website soon, along with an official plugin directory to make installing plugins easier - for now, there’s a basic getting started page on the wiki over at GitHub, and there will be more information over the coming days on both mine and Mike’s blog. Any questions in the meantime, then let me know.
Other than that, what are you waiting for? Get your Feather on!