kpumuk / meta-tags

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

Add Open Graph support for profile and product types #148

Closed Bahanix closed 6 years ago

Bahanix commented 6 years ago

I added missing tags for og:type product and profile.

Before: <meta name="profile:username" content="MyUsername" /> After: <meta property="profile:username" content="MyUsername" />

Sources:

kpumuk commented 6 years ago

Interesting. The logic in the code handles prefixes, so profile:username should be covered by profile only. I have tried following spec, and it passed on the current implementation:

  it "should display profile meta tags" do
    subject.display_meta_tags(og: { type: 'profile' }, profile: { username: 'kpumuk' }).tap do |meta|
      expect(meta).to have_tag('meta', with: { content: "profile", property: "og:type" })
      expect(meta).to have_tag('meta', with: { content: "kpumuk", property: "profile:username" })
    end
  end
Bahanix commented 6 years ago

My bad, I was using 2.4.1, then forked with 2.6.0 and was thinking it worked because of my changes. But everything works nicely with 2.6.0. Thanks for your work!

kpumuk commented 6 years ago

👍