Closed LizBayardelle closed 8 years ago
Do you have <%= display_meta_tags %>
in your layout file? set_meta_tags
is used on page templates to add meta tags defined in a layout. So,
Add this to your layout:
<%= display_meta_tags description: 'Welcome to the Manly Art of BBQ, the online knowledge stockpile of all things manly. This includes, but is not limited to, how to cook great barbecue.',
keywords: 'knowledge, home, BBQ, barbecue, manly, art',
site: 'The Manly Art of BBQ' %>
<% set_meta_tags title: 'Another page' %>
to set custom title, add tags, change description, etc.@LizBayardelle it's not too clear in the docs, but the order matters:
<% set_meta_tags description: 'Welcome to the Manly Art of BBQ, the online knowledge stockpile of all things manly. This includes, but is not limited to, how to cook great barbecue.',
keywords: 'knowledge, home, BBQ, barbecue, manly, art',
site: 'The Manly Art of BBQ' %>
<%= display_meta_tags %>
If you use set_meta_tags
in the layout, the values you passed will override the ones you set in your views. Instead, only display_meta_tags
should be used in the layout:
<%=
display_meta_tags(
description: 'Welcome to the Manly Art of BBQ, the online knowledge stockpile of all things manly. This includes, but is not limited to, how to cook great barbecue.',
keywords: 'knowledge, home, BBQ, barbecue, manly, art',
site: 'The Manly Art of BBQ',
)
%>
I installed the
meta-tags
gem and copied my usage straight out of the documentation:Unfortunately, when I check for meta data using a site like this one it still doesn't see the meta data I inputted.