mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-25 02:42:10 +00:00
done demo checklist
This commit is contained in:
15
app/helpers/meta_tags_helper.rb
Normal file
15
app/helpers/meta_tags_helper.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module MetaTagsHelper
|
||||
def meta_title
|
||||
content_for?(:meta_title) ? content_for(:meta_title) : DEFAULT_META["meta_title"]
|
||||
end
|
||||
|
||||
def meta_description
|
||||
content_for?(:meta_description) ? content_for(:meta_description) : DEFAULT_META["meta_description"]
|
||||
end
|
||||
|
||||
def meta_image
|
||||
meta_image = (content_for?(:meta_image) ? content_for(:meta_image) : DEFAULT_META["meta_image"])
|
||||
# little twist to make it work equally with an asset or a url
|
||||
meta_image.starts_with?("http") ? meta_image : image_url(meta_image)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user