Created
July 20, 2020 14:59
-
-
Save dceddia/93a57b574d26d31db1a225a14e581ef0 to your computer and use it in GitHub Desktop.
Open Graph tags (_includes/open-graph.html), included from _includes/head.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Twitter Cards --> | |
<meta name="twitter:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"> | |
{% if page.excerpt %}<meta name="twitter:description" content="{{ page.excerpt | strip_html }}">{% endif %} | |
{% if site.owner.twitter %}<meta name="twitter:site" content="@{{ site.owner.twitter }}">{% endif %} | |
{% if author.twitter %}<meta name="twitter:creator" content="@{{ author.twitter }}">{% endif %} | |
{% if page.image.twitter %} | |
<meta name="twitter:card" content="summary_large_image"> | |
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.twitter }}"> | |
{% elsif page.image.feature %} | |
<meta name="twitter:card" content="summary_large_image"> | |
<meta name="twitter:image" content="{{ site.url }}/images/{{ page.image.feature }}"> | |
{% elsif page.image == "none" %} | |
{% else %} | |
<meta name="twitter:card" content="summary"> | |
<meta name="twitter:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}"> | |
{% endif %} | |
<!-- Open Graph --> | |
<meta property="og:locale" content="{{ site.locale }}"> | |
<meta property="og:type" content="article"> | |
<meta property="og:title" content="{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}"> | |
{% if page.excerpt %}<meta property="og:description" content="{{ page.excerpt | strip_html }}">{% endif %} | |
{% if page.image.feature %} | |
<meta property="og:image" content="{{ site.url }}/images/{{ page.image.feature }}"> | |
{% elsif page.image == "none" %} | |
{% else %} | |
<meta property="og:image" content="{% if page.image.thumb %}{{ site.url }}/images/{{ page.image.thumb }}{% else %}{{ site.url }}/images/{{ site.logo }}{% endif %}"> | |
{% endif %} | |
<meta property="og:url" content="{{ page.url | replace:'index.html','' | prepend: site.url }}"> | |
<meta property="og:site_name" content="{{ site.title }}"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment