seo_fuel 0.0.2 → 0.0.3

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.md CHANGED
@@ -48,7 +48,7 @@ Display the edit button and the form on every page, by including these commands
48
48
 
49
49
  ## TODO
50
50
  This gem is in early development, there are still some things to do:
51
- - add system for default values (default_title(@article.title) for example)
51
+ - add system for default values (<% default_title(@article.title) %> for example)
52
52
  - add options for open_graph
53
53
  - add documentation
54
54
  - include testing
@@ -1 +1 @@
1
- <meta name="description" content="<%= current_page.description %>">
1
+ <meta name="description" content="<%= current_page.description if current_page %>">
@@ -1 +1 @@
1
- <meta name="keywords" content="<%= current_page.keywords %>">
1
+ <meta name="keywords" content="<%= current_page.keywords if current_page %>">
@@ -1 +1 @@
1
- <title><%= current_page.title %></title>
1
+ <title><%= title_to_show %></title>
@@ -1,2 +1,11 @@
1
1
  en:
2
-
2
+ seo:
3
+ button_text: "Edit SEO options"
4
+ cancel: "Cancel"
5
+ save: "Save"
6
+ form:
7
+ title: "Title tag"
8
+ title_tip: ""
9
+ description: "Description tag"
10
+ description_tip: ""
11
+ keywords: Keywords
@@ -1,3 +1,3 @@
1
1
  module SeoFuel
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -8,6 +8,20 @@ module SeoFuel
8
8
  link_to text, "#", class: "seo_fuel #{klass}", id: "edit_seo_btn"
9
9
  end
10
10
 
11
+ def default_title(title)
12
+ @default_title = title.force_encoding('utf-8')
13
+ end
14
+
15
+ def title_to_show
16
+ if current_page && current_page.title.present?
17
+ current_page.title
18
+ elsif @default_title.present?
19
+ @default_title
20
+ else
21
+ ""
22
+ end
23
+ end
24
+
11
25
  def edit_seo_dialog
12
26
  render :partial => "seo_tags/seo_options"
13
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seo_fuel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: