public
Description: A few helpers to make SEO a little easier
Clone URL: git://github.com/relevance/seo_helper.git
Search Repo:
seo_helper / README
100644 77 lines (48 sloc) 2.245 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
SeoHelper
===============
 
These are some simple little helper to make pages a little more SEO friendly.
 
Examples
========
 
page_title
 
  - should create a title with h1
  
      page_title('Hello World') => <h1>Hello World</h1>
  
  - should create a title with an alternate tag
  
      page_title('Hello World', :h3) => <h3>Hello World</h3>
  
  - should set the content for html page title
 
      see discussion for html_title that follows
 
html_title
 
  - should create an html title
 
      html_title('SiteName') => <title>SiteName</title>
  
  - should create an html title with content for html page title
  
      index.html.erb
        page_title('My Index')
    
      application.html.erb
        html_title('SiteName') => <title>My Index : SiteName</title>
 
  - should create an html title specified delimiter
  
      index.html.erb
        page_title('My Index')
  
      application.html.erb
        html_title('SiteName', '|') => <title>My Index | SiteName</title>
  
meta_tags
  - should create meta tags from a hash
  
      meta = {:description => 'This is the description', :keywords => 'these are keywords'}
      meta_tags(meta) =>
        <meta name="keywords" content="these are keywords" />
        <meta name="description" content="This is the description" />
 
breadcrumb_trail
  - should create a breadcrumb trail
  
      crumbs = [{:name => 'Home', :link => 'http://test.host/'},
                {:name => 'Shops'}]
      breadcrumb_trail(crumbs).should =>
        <div class="breadcrumbs"><a href="http://test.host/">Home</a> &gt; Shops</div>
  
  - should create a breadcrumb trail with a specified tag
 
      crumbs = [{:name => 'Home', :link => 'http://test.host/'},
                {:name => 'Shops'}]
      breadcrumb_trail(crumbs, :span).should =>
        <span class="breadcrumbs"><a href="http://test.host/">Home</a> &gt; Shops</span>
 
  - should create a breadcrumb trail with specified delimiter
 
    crumbs = [{:name => 'Home', :link => 'http://test.host/'},
              {:name => 'Shops'}]
    breadcrumb_trail(crumbs. :div, '|').should =>
      <div class="breadcrumbs"><a href="http://test.host/">Home</a> | Shops</div>
 
 
Copyright (c) 2008 Relevance, Inc., released under the MIT license