bobdenotter / seo

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

Feature request : default fallback image #67

Open ankedsgn opened 6 years ago

ankedsgn commented 6 years ago

Wishlist! It would be lovely if there would be a default image possibility. So you can, for instance, add the logo of the company in the OG tags when no image is present in the shared page.

The og:image is one of the four required properties (title, type, url and image) sauce

default:
    title: ""
    description: ""
    ogtype: "website" 
    image: "foo.jpg"

preferably like this, in the config.

Thx!


used version: 1.0.7

sbonardt commented 6 years ago

+1 👍

sbonardt commented 6 years ago

@anketwokings

If you add a custom _metatags.twig to your theme folder, and add an {% else %} to the OG:image part you have yourself a workaround:

{% if image|default() is not empty %}
        <meta property="og:image" content="{{ image }}" />
{% else %}
        <meta property="og:image" content="/path/to/the/default/image.jpg" />
{% endif 
%}