seo_fuel 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
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><%=
|
1
|
+
<title><%= title_to_show %></title>
|
data/config/locales/en.yml
CHANGED
data/lib/seo_fuel/version.rb
CHANGED
data/lib/seo_fuel/view_helper.rb
CHANGED
@@ -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
|