Skip to content

Instantly share code, notes, and snippets.

@CalvinAllen
Created January 22, 2020 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CalvinAllen/da51fbb157f0304f0d8b037d40d47788 to your computer and use it in GitHub Desktop.
Save CalvinAllen/da51fbb157f0304f0d8b037d40d47788 to your computer and use it in GitHub Desktop.
{% assign cover_image = page.path | prepend: '/' | prepend: site.source %}
{% capture cover_image_exists %}{% cover_exists {{ cover_image }} %}{% endcapture %}
{% if page.image and cover_image_exists == "true" %}
<meta property="og:image" content="{{ site.url }}{{ page.url }}{{ page.image }}" />
{% else %}
<meta property="og:image" content="{{ site.url }}/images/social/headshot.jpg" />
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment