kpumuk / meta-tags

Search Engine Optimization (SEO) for Ruby on Rails applications.
MIT License
2.73k stars 275 forks source link

`image` is not mirrored #176

Closed zaiste closed 5 years ago

zaiste commented 6 years ago

In a layout:

display_meta_tags og: {
  title: :title,
  site_name: :site,
  image: :image
}

In a controller:

set_meta_tags image: '/path/to/file.png' 

This doesn't set og:image.

kpumuk commented 6 years ago
  1. Only a handful of meta tags support aliasing. This includes :title, :site, and :full_title, :description, :keywords, and links.

  2. In your case instead of aliasing set the og:image directly:

    set_meta_tags og: { image: '/path/to/file.png' }
  3. Meta tag image is not a valid meta tag as far as I know:

    set_meta_tags image: '/path/to/file.png' 

    Will generate:

    <meta name="image" content="/path/to/file.png">