{% macro seo(
    title="",
    og_title="",
    author="",
    description="",
    site_url="",
    image="",
    image_height="",
    image_width=""
    ) -%}
  {% if title %}
  <title>{{ title }}</title>
  {% endif %}
  
  {% if og_title %}
  <meta property="og:title" content="{{ og_title }}">
  {% endif %}
  
  {% if author %}
  <meta name="author" content="{{ author }}">
  {% endif %}
  
  <meta property="og:locale" content="{{ config.extra.seo.og_locale | default(value="en-US") }}">
  
  {% if description %}
  <meta name="description" content="{{ description }}">
  <meta property="og:description" content="{{ description }}">
  {% endif %}
  
  {% if site_url %}
  <link rel="canonical" href="{{ site_url | safe }}">
  <meta property="og:url" content="{{ site_url | safe }}">
  {% endif %}
  
  {% if config.title %}
  <meta property="og:site_name" content="{{ config.title }}" />
  {% endif %}
  
  {% if image %}
    <meta property="og:image" content="{{ get_url(path=image) | safe }}">
    {% if image_height -%}
      <meta property="og:image:height" content="{{ image_height }}">
    {%- endif %}
    {% if image_width -%}
      <meta property="og:image:width" content="{{ image_width }}">
    {%- endif %}
  {% endif %}
  
  {% if page.date %}
    <meta property="og:type" content="article" />
    <meta property="article:published_time" content="{{ page.date | date(format="%+") }}">
  {% endif %}
  
  {% if image %}
    <meta name="twitter:card" content="summary_large_image"">
    <meta property="twitter:image" content="{{ get_url(path=image) | safe }}">
  {% else %}
    <meta name="twitter:card" content="summary">
  {% endif %}
  
  {% if og_title %}
    <meta property="twitter:title" content="{{ og_title }}">
  {% endif %}
  
  {% if config.extra.seo.twitter.site %}
    <meta name="twitter:site" content="@{{ config.extra.seo.twitter.site }}">
    {% if config.extra.seo.twitter_creator %}
      <meta name="twitter:creator" content="@{{  config.extra.seo.twitter.creator }}">
    {% endif %}
  {% endif %}
{% endmacro seo %}