|
|
Well we call them Google Sitemaps, but MSN and Yahoo are also on board and have formed sitemaps.org. So I guess we just call them XML sitemaps? The 3 search engines currently don’t support the full sitemaps protocol, which is shame, hopefully by later this year they will. First off : Mephisto, the Ruby on Rails blogging software that powers this site. Creating a sitemap is no trouble at all with the Mephisto sitemap plugin. Although to get it working on this blog, I had to change the following in
to:
Change +00:00 to what ever your timezone offset from UTC is. Hopefully this will be fixed in a later version of the sitemap plugin. | ||
|
I’m not going to make a full post on this because over on Rubyrailways.com they have an excellent post covering the main libraries for screen scraping in ruby. However it is a bit out of date being 7 months old, and since then 2 more excellent libraries have emerged. Hpricot from the Ruby Superstar _why which has just been updated to version 0.5 today! And Scrapi which is also excellent. | ||
|
Extracted from Mephisto is the handy plugin called permalink_fu. I wrote earlier about how to use to_param for nicer URLs, but these are even better. The plugin automatically turns a field in your model into something that could be a permalink, by stripping out all non english and non alphanumeric letters. It then saves this in a field in your database for future use. So, onto the HowTo: First, install the plugin in your rails app.
Now you need to add a field to your database to store the permalink.
In the migration we add the field called permalink.
Now for the model code
The permalink field is only populated after the record is validated, so if you have a bunch of records already in your database you can get the permalink field to populate with
If you already have lots of view code written then this is the easy way to get these routes working – in your controller :
However that doesn’t seem to pass the smell test using :id rather than :permalink, but will work fine.
Thats all! I’m always on the lookout for SEO related Rails topics to talk about so drop me a line @ questions | ||
Popular Incoming Search Queries For This Topic |
This Post Is Filed Under The Following CategoriesWeb Hosting Plans |
Tags Associated with This Post |
Affordable Web Hosting News Archives |



