vaersaagod / seomate

SEO, mate! It's important. That's why SEOMate provides the tools you need to craft all the meta tags, sitemaps and JSON-LD microdata you need - in one highly configurable, open and friendly package - with a super-light footprint.
MIT License
36 stars 8 forks source link

Make `additionalMeta` act as fallback instead of override #2

Closed rungta closed 5 years ago

rungta commented 5 years ago

Currently any values in the additionalMeta field end up overwriting values set in templates by creating an seomate object. Can the behaviour be altered to make the additionalMeta values act as defaults, which are used only if those fields are not already set either via the profile map, or via the template config? It would enable use cases such as this:

/* config/seomate.php */
return [
   'additionalMeta' => [ 'og:type' => 'website' ],
];
{# template/news/_entry.twig #}
{% set seomate = {
   meta: { 'og:type': 'article' },
} %}
aelvan commented 5 years ago

Good point, moved additionalMeta earlier in the processing order so that it is overrideable from templates. Updated in v1.0.1.