Closed philipithomas closed 2 years ago
How I'm temporarily solving this:
<% og_title = @page_title || "site name" %>
<%= display_meta_tags og: { title: og_title } %>
Nice case, thank you for reporting it. Would you mind trying out a branch to see if it solves your problem?
gem "meta_tags", git: "https://github.com/kpumuk/meta-tags", branch: "mirror-empty-title"
@kpumuk Yes, exactly. Thank you!
Thanks for the prompt fix!
Just released, 2.18.0 with this change. Thanks again
Here's my use case:
If a page's title is not specified, then I'd like to show the
og:title
as the site name.I can't just set
<% title: 'site name' %>
because that results in<title>site name | site name</title>
How might I do this? (Can I replace
:title
with some kind of a method call so that I can trigger a fallback?)The reason is my site homepage. Of all links on the site, the homepage is most likely to be shared. But, Twitter meta tag validations unless a
twitter:title
/og:title
is set.