{% comment %} Adds an iframe video embed from a YouTube or Vimeo link given in object_location. Sizing is controlled using Bootstrap "ratio" sizing. {%- endcomment -%} {% if page.object_location contains 'vimeo' %} {% assign vimeo_id = page.object_location | split: '/' | last %}
{%- elsif page.object_location contains 'youtu' -%} {% assign youtube_id = page.object_location | split: '/' | last %} {% if youtube_id contains 'v=' %}{% assign youtube_id = youtube_id | split: 'v=' | last | split: '&' | first %} {% elsif youtube_id contains '?' %}{% assign youtube_id = youtube_id | split: '?' | first %}{% endif %}
{% endif %}