Skip to content

Instantly share code, notes, and snippets.

@CalvinAllen
Created January 22, 2020 17:04
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/29b3ad9792c74edd65cdbd12878af31c to your computer and use it in GitHub Desktop.
Save CalvinAllen/29b3ad9792c74edd65cdbd12878af31c to your computer and use it in GitHub Desktop.
{% assign cover_image = post.path | prepend: '/' | prepend: site.source %}
{% capture cover_image_exists %}{% cover_exists {{ cover_image }} %}{% endcapture %}
{% if post.image and cover_image_exists == "true" %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ site.url }}{{ post.url }}{{ post.image }}" />
{% else %}
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ 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