Module: AngularRailsSeo::ViewHelpers
- Defined in:
- lib/angular_rails_seo/view_helpers.rb
Instance Method Summary collapse
-
#seo_data ⇒ Object
Returns SEO data as defined in initializes/seo.rb.
- #seo_default ⇒ Object
-
#seo_meta_author ⇒ Object
Author meta tags.
-
#seo_meta_description ⇒ Object
Description meta tags.
-
#seo_tags ⇒ Object
Inserts all SEO tags.
-
#seo_title ⇒ Object
Title tag.
Instance Method Details
#seo_data ⇒ Object
Returns SEO data as defined in initializes/seo.rb
6 7 8 9 10 11 12 13 14 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 6 def seo_data Rails.configuration.seo.each do |key, value| unless Regexp.new(value["regex"]).match(request.path).nil? return seo_default.merge(Rails.configuration.seo[key]) end end seo_default end |
#seo_default ⇒ Object
16 17 18 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 16 def seo_default Rails.configuration.seo["default"] end |
#seo_meta_author ⇒ Object
Author meta tags
22 23 24 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 22 def tag :meta, name: "author", content: seo_data["author"] end |
#seo_meta_description ⇒ Object
Description meta tags
28 29 30 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 28 def tag :meta, name: "description", content: seo_data["description"] end |
#seo_tags ⇒ Object
Inserts all SEO tags
34 35 36 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 34 def seo_title + + end |
#seo_title ⇒ Object
Title tag
40 41 42 |
# File 'lib/angular_rails_seo/view_helpers.rb', line 40 def seo_title content_tag :title, seo_data["title"], "ng-bind" => "pageTitle" end |