Sunday, April 26, 2009

The YAML is Ruby's SEO Friend

Each formatting language has a distinctive characteristic that sets it apart from the rest, hence why designers prefer the visual stunning of Flash, and us SEO enthusiasts enjoy HTML/CSS for its inherent ability to control text.

Using Ruby to build pages has with it a few issues with setting a style sheet (.erb) and modifying individual pages' meta descriptions, keywords and title. Simplifying this into an easy solution requires only three steps, none of which should give you a headache.

First off, make sure that your .erb layout and style sheet is asking the individual pages whether or not they have custom meta's or titles. The coding should appear as such on your .erb file:
Once your .erb is established as containing "back-up" meta (also layout main page), and properly requesting data from pages, use your .yaml file to instruct your pages on which layout and customizations to load. This is a very simple set of instructions that will make later updates and modifications a breeze, not to mention how easily you can compile and modify this data offline (excel spreadsheet, etc.). The .yaml layout should take two steps; designating which .erb assetts to customize, and meta input. After these two steps, your .yaml should look something like this:
# Built-in
layout: "your-selected-layout"
# Custom
title: "My SEO Yaml Title"
meta_description: "Individual page description"
meta_keywords: "ruby, rails, seo, fun"
*One note: Make sure your '@page.example' is the same as your 'example: "page info"'

When your .yaml file is ready to roll, you can type away in your content file, knowing full well that your page has the proper meta-tags. Within the .yaml, you are able to specify any customizations, from banners to tabs, and anything that is dynamic. Be sure to test your local copy for web browser compatibility first, tweak your keywords, and enjoy Ruby to the fullest.

Please comment any other features you think should be added or if you have a special way you deal with Ruby.

-Derek Kean

0 comments:

Post a Comment