Permalink
Browse files

nice working now

  • Loading branch information...
0 parents commit 3dc5eecd80569d4d04a7e2839e375fdc2b7477c6 @eadz committed Feb 24, 2010
Showing with 7,553 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +17 −0 .htaccess
  3. +3 −0 _config.yml
  4. +529 −0 _db/seo-on-rails.sql
  5. +213 −0 _layouts/default.html
  6. +47 −0 _layouts/post.html
  7. +9 −0 _posts/2007-1-23-welcome-to-seo-on-rails.textile
  8. +70 −0 _posts/2007-1-24-even-better-looking-urls-with-permalink_fu.textile
  9. +38 −0 _posts/2007-1-24-to_param-for-better-looking-urls.textile
  10. +29 −0 _posts/2007-1-24-urls-ending-in-html.textile
  11. +32 −0 _posts/2007-2-1-mephisto-google-sitemap.textile
  12. +12 −0 _posts/2007-2-1-screen-scraping-ruby.textile
  13. +44 −0 _posts/2007-2-3-getting-your-meta-tags-on-track.textile
  14. +24 −0 _posts/2007-2-3-rails-image-tag.textile
  15. +15 −0 _posts/2007-2-5-301-redirects-in-rails.textile
  16. +6 −0 _posts/2007-2-8-scrubyt-screen-scraping.textile
  17. +36 −0 _posts/2008-6-15-title_tag_helper.textile
  18. +160 −0 _posts/2008-9-1-seo-friendly-ajax.textile
  19. +26 −0 _posts/2008-9-4-rails-seo-around-the-web.textile
  20. +11 −0 _posts/2009-6-7-rails-seo-starter-guide.textile
  21. +9 −0 _posts/2010-2-24-seo-impact-of-rails-3.html
  22. +258 −0 _site/301-redirects-in-rails.html
  23. +260 −0 _site/archives.html
  24. +303 −0 _site/even-better-looking-urls-with-permalink_fu.html
  25. +426 −0 _site/feed/atom.xml
  26. +281 −0 _site/getting-your-meta-tags-on-track.html
  27. BIN _site/images/Thumbs.db
  28. BIN _site/images/about.jpg
  29. BIN _site/images/ad.jpg
  30. BIN _site/images/bg.jpg
  31. BIN _site/images/comment-arrow.jpg
  32. BIN _site/images/content-sep.jpg
  33. BIN _site/images/content_bg.jpg
  34. BIN _site/images/content_top.jpg
  35. BIN _site/images/date.jpg
  36. BIN _site/images/footer_bg.jpg
  37. BIN _site/images/footer_l.jpg
  38. BIN _site/images/footer_r.jpg
  39. BIN _site/images/header_bg.jpg
  40. BIN _site/images/icon-author.jpg
  41. BIN _site/images/icon-category.jpg
  42. BIN _site/images/icon-comment.jpg
  43. BIN _site/images/icon-edit.jpg
  44. BIN _site/images/icon-tag.jpg
  45. BIN _site/images/left-sidebar-sep.jpg
  46. BIN _site/images/logo.jpg
  47. BIN _site/images/logo_bg.jpg
  48. BIN _site/images/rss_bg.jpg
  49. BIN _site/images/search-bar.jpg
  50. BIN _site/images/sidebar_sep.jpg
  51. BIN _site/images/top.jpg
  52. BIN _site/images/ul-post-arrow.jpg
  53. BIN _site/images/ul-sidebar-arrow.jpg
  54. +809 −0 _site/index.html
  55. +271 −0 _site/mephisto-google-sitemap.html
  56. +264 −0 _site/rails-image-tag.html
  57. +268 −0 _site/rails-seo-around-the-web.html
  58. +253 −0 _site/rails-seo-starter-guide.html
  59. +3 −0 _site/robots.txt
  60. +255 −0 _site/screen-scraping-ruby.html
  61. +252 −0 _site/scrubyt-screen-scraping.html
  62. +339 −0 _site/seo-friendly-ajax.html
  63. +254 −0 _site/seo-impact-of-rails-3.html
  64. +18 −0 _site/sitemap.txt
  65. +217 −0 _site/style.css
  66. +274 −0 _site/title_tag_helper.html
  67. +276 −0 _site/to_param-for-better-looking-urls.html
  68. +268 −0 _site/urls-ending-in-html.html
  69. +254 −0 _site/welcome-to-seo-on-rails.html
  70. +53 −0 _tools/export.rb
  71. +25 −0 archives.html
  72. +27 −0 feed/atom.xml
  73. BIN images/Thumbs.db
  74. BIN images/about.jpg
  75. BIN images/ad.jpg
  76. BIN images/bg.jpg
  77. BIN images/comment-arrow.jpg
  78. BIN images/content-sep.jpg
  79. BIN images/content_bg.jpg
  80. BIN images/content_top.jpg
  81. BIN images/date.jpg
  82. BIN images/footer_bg.jpg
  83. BIN images/footer_l.jpg
  84. BIN images/footer_r.jpg
  85. BIN images/header_bg.jpg
  86. BIN images/icon-author.jpg
  87. BIN images/icon-category.jpg
  88. BIN images/icon-comment.jpg
  89. BIN images/icon-edit.jpg
  90. BIN images/icon-tag.jpg
  91. BIN images/left-sidebar-sep.jpg
  92. BIN images/logo.jpg
  93. BIN images/logo_bg.jpg
  94. BIN images/rss_bg.jpg
  95. BIN images/search-bar.jpg
  96. BIN images/sidebar_sep.jpg
  97. BIN images/top.jpg
  98. BIN images/ul-post-arrow.jpg
  99. BIN images/ul-sidebar-arrow.jpg
  100. +63 −0 index.html
  101. +22 −0 rewrite.rb
  102. +3 −0 robots.txt
  103. +8 −0 sitemap.txt
  104. +217 −0 style.css
@@ -0,0 +1,2 @@
+_drafts/
+images/.DS_Store
@@ -0,0 +1,17 @@
+RewriteEngine on
+
+RewriteRule welcome-to-seo-on-rails$ http://www.seoonrails.com/welcome-to-seo-on-rails.html [L,R=301]
+RewriteRule even-better-looking-urls-with-permalink_fu$ http://www.seoonrails.com/even-better-looking-urls-with-permalink_fu.html [L,R=301]
+RewriteRule to_param-for-better-looking-urls$ http://www.seoonrails.com/to_param-for-better-looking-urls.html [L,R=301]
+RewriteRule urls-ending-in-html$ http://www.seoonrails.com/urls-ending-in-html.html [L,R=301]
+RewriteRule mephisto-google-sitemap$ http://www.seoonrails.com/mephisto-google-sitemap.html [L,R=301]
+RewriteRule screen-scraping-ruby$ http://www.seoonrails.com/screen-scraping-ruby.html [L,R=301]
+RewriteRule getting-your-meta-tags-on-track$ http://www.seoonrails.com/getting-your-meta-tags-on-track.html [L,R=301]
+RewriteRule rails-image-tag$ http://www.seoonrails.com/rails-image-tag.html [L,R=301]
+RewriteRule 301-redirects-in-rails$ http://www.seoonrails.com/301-redirects-in-rails.html [L,R=301]
+RewriteRule scrubyt-screen-scraping$ http://www.seoonrails.com/scrubyt-screen-scraping.html [L,R=301]
+RewriteRule title_tag_helper$ http://www.seoonrails.com/title_tag_helper.html [L,R=301]
+RewriteRule seo-friendly-ajax$ http://www.seoonrails.com/seo-friendly-ajax.html [L,R=301]
+RewriteRule rails-seo-around-the-web$ http://www.seoonrails.com/rails-seo-around-the-web.html [L,R=301]
+RewriteRule rails-seo-starter-guide$ http://www.seoonrails.com/rails-seo-starter-guide.html [L,R=301]
+RewriteRule seo-impact-of-rails-3$ http://www.seoonrails.com/seo-impact-of-rails-3.html [L,R=301]
@@ -0,0 +1,3 @@
+markdown: rdiscount
+#pygments: true
+permalink: /:title.html

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,213 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
+
+<head profile="http://gmpg.org/xfn/11">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+
+<title>{{ page.title }} - SEO on Rails</title>
+
+<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
+<link rel="alternate" type="application/atom+xml" title="SEO on Rails feed" href="http://feeds.feedburner.com/seo-rails"/>
+
+
+<!--[if IE 6]>
+<style type="text/css">
+.comment-form{margin-bottom: -3px}
+</style>
+<![endif]-->
+
+</head>
+<body id="top">
+<div id="container">
+ <div id="wrapper">
+
+ <div id="header">
+ <div id="logo">
+
+ <!-- Your Logo image - max-width: 200px -->
+ <!-- USAGE:
+ 1-create your own logo and save it as logo.jpg in the folder "images" in your theme folder.
+ 2-uncomment code below:-->
+ <!-- <a class="logo" href="http://web-kreation.com/demos/oneroom/" title="Back Home"></a>
+ -->
+ <h1><a href="http://www.seoonrails.com/">SEO on Rails</a></h1>
+ </div>
+
+ <!-- ADMIN NAVIGATION -->
+ <!--<ul id="navAdmin">
+ <li><a href="http://web-kreation.com/demos/oneroom/wp-login.php">Log in</a></li>
+
+ </ul>
+
+ <!-- MAIN NAVIGATION
+ <div class="menu"><ul><li class="current_page_item"><a href="http://web-kreation.com/demos/oneroom" title="Home">Home</a></li><li class="page_item page-item-57"><a href="http://web-kreation.com/demos/oneroom/index.php/typography/" title="Typography">Typography</a></li><li class="page_item page-item-2"><a href="http://web-kreation.com/demos/oneroom/index.php/usage/" title="Usage">Usage</a></li><li class="page_item page-item-51"><a href="http://web-kreation.com/demos/oneroom/index.php/license/" title="License">License</a></li><li class="page_item page-item-61"><a href="http://web-kreation.com/demos/oneroom/index.php/contact/" title="Contact">Contact</a></li></ul></div> -->
+
+ <!-- Alternative navigation
+ <ul class="menu">
+ <li class="current_page_item"><a href="http://web-kreation.com/demos/oneroom/">Home</a></li>
+ <li class="page_item page-item-57"><a href="http://web-kreation.com/demos/oneroom/index.php/typography/" title="Typography">Typography</a></li>
+<li class="page_item page-item-2"><a href="http://web-kreation.com/demos/oneroom/index.php/usage/" title="Usage">Usage</a></li>
+<li class="page_item page-item-51"><a href="http://web-kreation.com/demos/oneroom/index.php/license/" title="License">License</a></li>
+<li class="page_item page-item-61"><a href="http://web-kreation.com/demos/oneroom/index.php/contact/" title="Contact">Contact</a></li>
+ <li><a href="http://yourExternalLinkHere.com">External Link</a></li>
+ </ul> -->
+
+ <!-- / END MAIN NAVIGATION -->
+
+
+ <!-- FEED -->
+
+ <a id="rss" href="http://feeds.feedburner.com/seo-rails" title="Syndicate this site using RSS">SUBSCRIBE TO <b>RSS</b></a>
+
+ </div>
+
+ <div id="pageWrapper">
+
+<div id="content">
+
+ {{ content }}
+
+
+
+
+ <div class="nav nav-border-bottom">
+ <div class="alignleft"><a href="/archives.html" >&laquo; Older Entries</a>&nbsp;</div>
+
+ <div class="alignright">&nbsp;</div>
+ </div>
+
+
+</div> <!-- / content -->
+
+ <div id="sidebar">
+
+ <ul>
+ <!--
+ <li class="nobackground">
+ <form method="get" id="searchform" action="http://web-kreation.com/demos/oneroom/">
+
+ <div>
+ <input class="search-field" type="text" onfocus="this.value=''" onblur="this.value='Search...'" value="Search..." name="s" id="s" />
+ <input class="search-submit" type="submit" value="" />
+ </div>
+ </form>
+ </li>
+ -->
+ <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it. -->
+ <li><h2>About SEO on Rails</h2>
+
+ <p>This website provides tips, tricks and code to help you to make your Ruby on Rails powered sites more search engine friendly and optimized.
+</p><p>
+ If you have any Rails related SEO questions, feel free to drop me a line at questions @ this domain .com</p>
+ </li>
+
+ <!-- Banners / OPTIONAL -->
+ <!-- Banners' size must be 125x125 -->
+ <li class="ads clearfix"><h2>Our Sponsors</h2>
+ <!-- First Row -->
+ <a class="ad-left" href="mailto:info@seoonrails.com?subject=seoonrails.com-ads"><img src="images/ad.jpg" alt="" /></a>
+
+ <a class="ad-right" href="mailto:info@seoonrails.com?subject=ads"><img src="images/ad.jpg" alt="" /></a>
+ </li>
+
+<!--
+
+ <li class="pagenav"><h2>Pages</h2><ul><li class="page_item page-item-57"><a href="http://web-kreation.com/demos/oneroom/index.php/typography/" title="Typography">Typography</a></li>
+<li class="page_item page-item-2"><a href="http://web-kreation.com/demos/oneroom/index.php/usage/" title="Usage">Usage</a></li>
+<li class="page_item page-item-51"><a href="http://web-kreation.com/demos/oneroom/index.php/license/" title="License">License</a></li>
+<li class="page_item page-item-61"><a href="http://web-kreation.com/demos/oneroom/index.php/contact/" title="Contact">Contact</a></li>
+</ul></li>
+
+ <!-- Optional - Latest Posts
+ <li><h2>Latest Posts</h2>
+ <ul>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/animals/oneroom-free-wordpress-theme-by-web-kreation/' title='OneRoom &#8211; Free WP Theme by Web-Kreation'>OneRoom &#8211; Free WP Theme by Web-Kreation</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/animals/at-vero-eos-et-accusamus-et-iusto/' title='At vero eos et accusamus et iusto'>At vero eos et accusamus et iusto</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/animals/et-quas-molestias-excepturi-sint-occaecati-cupiditate/' title='Et quas molestias excepturi sint occaecati cupiditate'>Et quas molestias excepturi sint occaecati cupiditate</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/animals/et-harum-quidem-rerum-facilis-est-et-expedita-distinctio/' title='Et harum quidem rerum facilis est et expedita distinctio.'>Et harum quidem rerum facilis est et expedita distinctio.</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/animals/excepteur-sint-occaecat-cupidatat-non-proident/' title='Excepteur sint occaecat cupidatat non proident'>Excepteur sint occaecat cupidatat non proident</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/travel/ut-enim-ad-minim-veniam/' title='Ut enim ad minim veniam,'>Ut enim ad minim veniam,</a></li>
+ </ul>
+ </li>-->
+<!--
+ <li><h2>Archives</h2>
+ <ul>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/2009/02/' title='February 2009'>February 2009</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/2009/01/' title='January 2009'>January 2009</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/2008/12/' title='December 2008'>December 2008</a></li>
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/2008/10/' title='October 2008'>October 2008</a></li>
+
+ <li><a href='http://web-kreation.com/demos/oneroom/index.php/2008/09/' title='September 2008'>September 2008</a></li>
+ </ul>
+ </li>
+
+ <li class="categories"><h2>Categories</h2><ul> <li class="cat-item cat-item-25"><a href="http://web-kreation.com/demos/oneroom/index.php/category/animals/" title="View all posts filed under Animals">Animals</a> (6)
+</li>
+ <li class="cat-item cat-item-29"><a href="http://web-kreation.com/demos/oneroom/index.php/category/insects/" title="View all posts filed under Insects">Insects</a> (2)
+
+</li>
+ <li class="cat-item cat-item-26"><a href="http://web-kreation.com/demos/oneroom/index.php/category/nature/" title="View all posts filed under Nature">Nature</a> (6)
+</li>
+ <li class="cat-item cat-item-13"><a href="http://web-kreation.com/demos/oneroom/index.php/category/travel/" title="View all posts filed under Travel">Travel</a> (1)
+</li>
+</ul></li>
+
+-->
+ <li id="linkcat-2" class="linkcat"><h2>Reccomended</h2>
+ <ul class='xoxo blogroll'>
+
+<li><a href="http://www.therailsway.com">The Rails Way</a></li>
+<li><a href="http://www.seobook.com/">SEO Book</a></li>
+<li><a href="http://www.railscasts.com/">Railscasts</a></li>
+<li><a href="http://www.rubyserve.com/">Hosted by Rubyserve</a></li>
+
+ </ul>
+
+</li>
+
+
+ </div>
+
+
+
+ <div class="clear"></div>
+ </div><!-- / pageWrapper -->
+
+ <div id="footer">
+ <div class="foot_l">&nbsp;</div>
+ <div class="foot_content">
+ <div class=""></div>
+
+ <p>
+ All contents copyright &copy;Seo on Rails. All rights reserved. |
+
+ <!-- PLEASE DO NOT EDIT OR DELETE THE CODE BELOW THIS LINE -->
+ <!-- License: http://web-kreation.com/demos/oneroom/index.php/license/ -->
+ <!-- If you want to remove this copyright notice, please contact me at info {at} web-kreation {dot} com -->
+ Theme design by <a href="http://web-kreation.com">Web-Kreation</a>.
+ <!-- / END -->
+
+ </p>
+ </div>
+ <div class="foot_r">&nbsp;</div>
+ <a href="#top" id="toTop">&nbsp;</a>
+ </div><!-- / footer -->
+
+ </div><!-- / Wrapper -->
+
+ <!-- Stunning design by Jeeremie - http://web-kreation.com -->
+
+
+
+</div><!-- / container -->
+<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
+</script>
+<script type="text/javascript">
+_uacct = "UA-32073-10";
+urchinTracker();
+</script>
+<script type='text/javascript' src='http://track3.mybloglog.com/js/jsserv.php?mblID=2007012908320762'></script>
+
+</body>
+</html>
+
@@ -0,0 +1,47 @@
+---
+layout: default
+---
+
+
+
+
+
+ <div class="postWrapper">
+
+
+
+
+ <div class="postmetadata">
+ <p class="meta-date">
+ <span class="date-day">{{ page.date | date: "%d"}}</span>
+ <span class="date-month">{{page.date| date: "%b"}}</span>
+
+ <span class="date-year">{{page.date|date: "%Y"}}</span>
+ </p>
+ <p class="meta-author">by Eaden McKee</p>
+ <!--<a href="link to comments" class="meta-comments" title=""></a>-->
+
+
+ <p class="meta-tags">
+ {{page.tags }} </div>
+
+<div class="post" id="post-3">
+ <h1><a href="{{ post.url }}" rel="bookmark" >{{ page.title }}</a></h1>
+
+ <div class="entry">
+
+ {{ content }}
+ <!-- <div id="attachment_138" class="wp-caption aligncenter" style="width: 480px"><img src="http://web-kreation.com/demos/oneroom/wp-content/uploads/2009/02/nature-1.jpg" alt="Lorem ipsum dolor sit amet" title="nature-1" width="470" height="180" class="size-full wp-image-138" /><p class="wp-caption-text">Lorem ipsum dolor sit amet</p></div>
+<h2>About this Theme</h2>
+<p><a href="http://web-kreation.com/index.php/wordpress/oneroom-another-free-wordpress-theme-by-web-kreation" title="Go back to the article"><strong>OneRoom</strong></a> is a free Wordpress theme designed by <a href="http://web-kreation.com">Web-Kreation</a> whose blog you will find at <a href="http://web-kreation.com/index.php/blog/">http://web-kreation.com/index.php/blog/</a>. This theme is valid <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fweb-kreation.com%2Fdemos%2Foneroom&#038;charset=(detect+automatically)&#038;doctype=Inline&#038;group=0" target="_blank" rel="nofollow">(X)HTML</a> &#038; <a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fweb-kreation.com%2Fdemos%2Foneroom&#038;profile=css21&#038;usermedium=all&#038;warning=1&#038;lang=es" target="_blank" rel="nofollow">CSS</a>.</p> -->
+
+
+
+
+ </div>
+ </div>
+ </div>
+
+
+
+
@@ -0,0 +1,9 @@
+---
+layout: post
+title: Welcome to SEO on Rails
+---
+First Post!
+
+Welcome to SEO on Rails. I hope to bring you lots of tips, code and ideas to help your Ruby on Rails powered site more search engine friendly and optimized.
+
+If you have any rails related SEO questions, please email me - questions @ this domain.
@@ -0,0 +1,70 @@
+---
+layout: post
+title: Even better looking URLs with permalink_fu
+tags: urls,rails,routes,permalinks,plugins
+---
+Extracted from "Mephisto":http://www.mephistoblog.com/ is the handy plugin called "permalink_fu":http://svn.techno-weenie.net/projects/plugins/permalink_fu/.
+This plugin allows you to use ID-less permalinks, much like that in this blog.
+
+I wrote earlier about how to use "to_param":http://www.seoonrails.com/to_param-for-better-looking-urls 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.
+
+<pre><code>
+./script/plugin install http://svn.techno-weenie.net/projects/plugins/permalink_fu/
+</code></pre>
+
+Now you need to add a field to your database to store the permalink.
+
+<pre><code>
+./script/generate migration add_permalink_to_article
+</code></pre>
+
+In the migration we add the field called permalink.
+
+<pre><code>
+add_column :designers, :permalink, :string
+</code></pre>
+
+Now for the model code
+<pre><code>
+class Article < ActiveRecord::Base
+ # title is the field name you want to convert to a permalink
+ has_permalink :title
+ # you can also specifiy a different permalink field in your database by giving a second paramater
+ # has_permalink :title, :my_permalink_field
+
+ # we now add the to_param method which Rails's routing uses
+ def to_param
+ permalink
+ end
+end
+</code></pre>
+
+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
+
+<pre><code>
+Article.find(:all).each(&:save)
+</code></pre>
+
+If you already have lots of view code written then this is the easy way to get these routes working - in your controller :
+<pre><code>
+@article = Article.find_by_permalink(params[:id])
+</code></pre>
+
+However that doesn't seem to pass the smell test using :id rather than :permalink, but will work fine.
+To use :permalink you will have to change your routing code and your view code :
+
+<pre><code>
+# in your route file
+map.connect 'article/:permalink', :controller => 'article', :action => 'view'
+# in your views when linking
+link_to "View #{article.title}", {:controller => 'designer', :action => 'view', :permalink => article.permalink}
+# then in your controller you can use
+@article = Article.find_by_permalink(params[:permalink])
+</code></pre>
+
+Thats all! I'm always on the lookout for SEO related Rails topics to talk about so drop me a line @ questions -at- this domain .com.
Oops, something went wrong.

0 comments on commit 3dc5eec

Please sign in to comment.