bobdenotter / seo

Bolt SEO extension
https://bobdenotter.github.io/seo/
MIT License
48 stars 34 forks source link

Can't get custom metatags template to work #71

Closed tkeil69575 closed 6 years ago

tkeil69575 commented 6 years ago

Running Bolt 3.4.9 with php 5.6. I've uncommented the

templates:
    meta: @bolt/_metatags.twig 

in the configuration file and created a custom _metatags.twig in my partials theme folder to which I added the following:

<!-- Custom Metatags -->
{% if description|default() is not empty %}
<meta name="description" content="{{ description }}"/>
{% if keywords|default() is not empty %}
<meta name="keywords" content="{{ keywords }}"/>
{% endif %}
{% endif %}
<meta property="og:locale" content="{{ htmllang()|replace({'-': '_'}) }}" />
<meta property="og:type" content="{{ ogtype|default('website') }}" />
<meta property="og:title" content="{{ title }}" />
{% if description|default() is not empty %}
<meta property="og:description" content="{{ description }}" />
{% endif %}
<meta property="og:url" content="{{ canonical }}" />
<meta property="og:site_name" content="{{ app.config.get('general/sitename') }}" />
{% if image|default() is not empty %}
<meta property="og:image" content="{{ image }}" />
{% endif %}
<meta name="robots" content="{{ robots }}" />

In my _master.twig I added "{{ seo.metatags() }}". However, the custom template is not being picked up, the default template continues to be shown. Any clues to what I am doing wrong?

tkeil69575 commented 6 years ago

okay, figured it out :) had to set configuration to

templates:
     meta: partials/_metatags.twig