Module: Cortex::Snippets::Client::Helper
- Defined in:
- lib/cortex/snippets/client/helper.rb
Instance Method Summary collapse
- #noarchive ⇒ Object
- #nofollow ⇒ Object
- #noimageindex ⇒ Object
- #noindex ⇒ Object
- #noodp ⇒ Object
- #nosnippet ⇒ Object
- #seo_description ⇒ Object
- #seo_keywords ⇒ Object
- #seo_title ⇒ Object
- #snippet(options = {}, &block) ⇒ Object
Instance Method Details
#noarchive ⇒ Object
44 45 46 |
# File 'lib/cortex/snippets/client/helper.rb', line 44 def noarchive webpage[:noarchive] end |
#nofollow ⇒ Object
32 33 34 |
# File 'lib/cortex/snippets/client/helper.rb', line 32 def nofollow webpage[:nofollow] end |
#noimageindex ⇒ Object
48 49 50 |
# File 'lib/cortex/snippets/client/helper.rb', line 48 def noimageindex webpage[:noimageindex] end |
#noindex ⇒ Object
28 29 30 |
# File 'lib/cortex/snippets/client/helper.rb', line 28 def noindex webpage[:noindex] end |
#noodp ⇒ Object
36 37 38 |
# File 'lib/cortex/snippets/client/helper.rb', line 36 def noodp webpage[:noodp] end |
#nosnippet ⇒ Object
40 41 42 |
# File 'lib/cortex/snippets/client/helper.rb', line 40 def nosnippet webpage[:nosnippet] end |
#seo_description ⇒ Object
20 21 22 |
# File 'lib/cortex/snippets/client/helper.rb', line 20 def seo_description webpage[:seo_description] end |
#seo_keywords ⇒ Object
24 25 26 |
# File 'lib/cortex/snippets/client/helper.rb', line 24 def seo_keywords webpage[:seo_keywords] end |
#seo_title ⇒ Object
16 17 18 |
# File 'lib/cortex/snippets/client/helper.rb', line 16 def seo_title webpage[:seo_title] end |
#snippet(options = {}, &block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cortex/snippets/client/helper.rb', line 5 def snippet( = {}, &block) snippets = webpage[:snippets] || [] snippet = snippets.find { |snippet| snippet[:document][:name] == [:id] } if snippet.nil? || snippet[:document][:body].nil? || snippet[:document][:body].empty? content_tag(:snippet, capture(&block), ) else content_tag(:snippet, snippet[:document][:body].html_safe, ) end end |