butschster / LaravelMetaTags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project
MIT License
540 stars 50 forks source link

OpenGraph wrong tag attributename #17

Closed p0g closed 4 years ago

p0g commented 4 years ago

In the OpenGraphPackage you are using the same tag generator like other meta-tags, but this is not working for OpenGraph: Generated, wrong tag: <meta name="og:type" content="website"> Correct tag would be: <meta property="og:type" content="website">

See: https://developers.facebook.com/docs/sharing/webmasters

My quick "bugfix" local, is to extend vendor/butschster/meta-tags/src/Packages/Entities/Concerns/ManageMeta.php with:

public function addOgMeta(string $key, string $content) { $key = $this->prefix.$key; $this->tags->put($key, Tag::meta([ 'property' => $key, 'content' => $content, ])); return $this; }

And replace $this->addMeta with $this->addOgMeta in vendor/butschster/meta-tags/src/Packages/Entities/OpenGraphPackage.php

butschster commented 4 years ago

Thank you!