{% if seo is defined and seo %}
    {% if seo.canonical %}
        <link rel="canonical" href="{{ seo.canonical }}">
    {% endif %}
    {% if seo.description %}
        <meta name="description" content="{{ seo.description }}">
    {% endif %}
    {% if seo.noindex %}
        <meta name="robots" content="noindex, nofollow">
    {% else %}
        <meta name="robots" content="index, follow">
    {% endif %}
    <meta property="og:site_name" content="{{ site.name }}">
    <meta property="og:title" content="{{ seo.title }}">
    {% if seo.description %}
        <meta property="og:description" content="{{ seo.description }}">
    {% endif %}
    {% if seo.canonical %}
        <meta property="og:url" content="{{ seo.canonical }}">
    {% endif %}
    <meta property="og:type" content="{{ seo.type|default('website') }}">
    {% if seo.image %}
        <meta property="og:image" content="{{ seo.image }}">
        {% if seo.image_width %}
            <meta property="og:image:width" content="{{ seo.image_width }}">
        {% endif %}
        {% if seo.image_height %}
            <meta property="og:image:height" content="{{ seo.image_height }}">
        {% endif %}
        {% if seo.image_type %}
            <meta property="og:image:type" content="{{ seo.image_type }}">
        {% endif %}
    {% endif %}
    {% if seo.published_time %}
        <meta property="article:published_time" content="{{ seo.published_time }}">
    {% endif %}
    <meta name="twitter:card" content="{% if seo.image %}summary_large_image{% else %}summary{% endif %}">
    <meta name="twitter:title" content="{{ seo.title }}">
    {% if seo.description %}
        <meta name="twitter:description" content="{{ seo.description }}">
    {% endif %}
    {% if seo.image %}
        <meta name="twitter:image" content="{{ seo.image }}">
    {% endif %}
{% endif %}