mbleigh-canonical-url 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -30,7 +30,7 @@ The plugin is very simple to use and consists of a controller method and a helpe
30
30
  ...
31
31
  </html>
32
32
 
33
- This will automatically insert a canonical URL tag into every page of your site, defaulting to the request's current URL (we assume that the current URL is the canonical URL for any page where it is not specified). Then you can set canonical URLs in the controller as follows:
33
+ This will automatically insert a canonical URL tag into every page of your site, defaulting to the request's current URL (it will not output anything when you have not specified a canonical URL through the controller or explicitly through the link tag). Then you can set canonical URLs in the controller as follows:
34
34
 
35
35
  class BlogController < ApplicationController
36
36
  def show
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :minor: 1
3
+ :patch: 1
4
+ :major: 0
data/lib/canonical_url.rb CHANGED
@@ -12,6 +12,7 @@ module CanonicalURL
12
12
 
13
13
  module Helpers
14
14
  def canonical_link_tag(url = nil)
15
+ return '' unless url || @canonical_url
15
16
  tag('link', :rel => 'canonical', :href => url || @canonical_url || request.url)
16
17
  end
17
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbleigh-canonical-url
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -23,6 +23,7 @@ extra_rdoc_files: []
23
23
 
24
24
  files:
25
25
  - README.markdown
26
+ - VERSION.yml
26
27
  - lib/canonical_url.rb
27
28
  has_rdoc: true
28
29
  homepage: http://github.com/mbleigh/canonical-url