{% comment %} Adds Item page button links, styled as a Bootstrap btn-group. Features: - View Transcript -- if the item has the field "object_transcript", this button is added along with a Bootstrap collapse containing the transcript content. If the value of "object_transcript" starts with objects/ it will look for the matching transcript file in the objects fold, otherwise it will use the value directly. Both will be rendered in Markdown. - View on Timeline -- if the item has a "date" value, links to Timeline page. - View on Map -- if item has "latitude" and "longitude" value, links to location on map. - Download -- if the item has "object_location" value, adds a download button along with the item format, or if the value is a YouTube or Vimeo link adds a "View on" link. {%- endcomment -%}
{% if page.object_transcript %}{% endif %} {% if page.date %}{%- capture year -%}{% if page.date contains "-" %}{{ page.date | split: "-" | first }}{% elsif page.date contains "/" %}{{ page.date | split: "/" | last }}{% else %}{{ page.date }}{% endif %}{%- endcapture -%} View on Timeline{% endif %} {% if page.latitude and page.longitude %} View on Map{% endif %} {% if page.object_location %} {% if page.display_template == 'video' and page.object_location contains 'vimeo' %}View on Vimeo{% elsif page.display_template == 'video' and page.object_location contains 'youtu' %}View on YouTube{% elsif page.display_template == 'record'%}Link to Object{% else %}Download {{ page.format | split: '/' | last | default: page.display_template | upcase }}{% endif %} {% endif %}
{% if page.object_transcript %}
{% assign transcript_type = page.object_transcript | slice: 0,1 %} {% if transcript_type == '/' %} {% assign transcript_location = page.object_transcript | remove_first: '/' %} {% assign transcript = site.pages | where: 'path', transcript_location | first %} {{ transcript.content | markdownify }} {% else %} {{ page.object_transcript | markdownify }} {% endif %}
{% endif %}