Skip to content

Commit 64881b4

Browse files
committed
Modify output to not assume view logic
1 parent 5c48346 commit 64881b4

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

lib/cortex/snippets/client/helper.rb

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ def seo_keywords
2626
end
2727

2828
def seo_robots
29-
build_robot_information
29+
robot_information = []
30+
index_options = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex]
31+
32+
index_options.each do |index_option|
33+
robot_information << index_option if webpage[index_option]
34+
end
35+
36+
robot_information
3037
end
3138

3239
def noindex
@@ -58,21 +65,6 @@ def noimageindex
5865
def webpage
5966
Cortex::Snippets::Client::current_webpage(request)
6067
end
61-
62-
def build_robot_information
63-
robot_information = []
64-
index_options = [:noindex, :nofollow, :noodp, :nosnippet, :noarchive, :noimageindex]
65-
66-
index_options.each do |index_option|
67-
robot_information << index_option if valid_index_option?(index_option)
68-
end
69-
70-
robot_information.join(", ")
71-
end
72-
73-
def valid_index_option?(index_option)
74-
webpage[index_option]
75-
end
7668
end
7769
end
7870
end

0 commit comments

Comments
 (0)