{% comment %} Audio modal feature from an item's objectid or external link. This include adds a card featuring the thumb image, title, and description of an audio item--when clicked it opens a modal containing the audio embed. The modal displays audio information, transcript, link to item. This is especially useful feature if you would like multiple videos on one page. E.G. --> {% include feature/audio-modal.html objectid="demo_003" %} It requires an "objectid" with the include, which is used to find the audio details. Alternatively, a URL to an external audio file can be used in "objectid". Options: - "objectid" = several options below (required) - an objectid of an audio item in this collection, e.g. "demo_003" - an external link to an MP3 file hosted elsewhere, e.g. "https://www.lib.uidaho.edu/digital/mp3s/Clouds.mp3" - a relative link to an MP3 file somewhere else in this repository, e.g. "/assets/{{ includeid }}.mp3" - "title" = by default automatically adds the title from item metadata, which will be used for the modal btn and modal title. Manually set by using the title option. (optional) - "heading_level" = customize the level of the heading if necessary for accessibility, choose "h1", "h2", "h3", etc (optional, default "h2") - "caption" = by default the figure include automatically uses the description of the item from your metadata. The caption option allows you to manually add a different caption, or give the value false for none. (optional) - "image" = by default if using an objectid, if the item has a image_small value, the image will be used on the card. The image option allows you to manually add a image for non-collection videos. Give "false" to not display an image (optional) - "transcript" = by default if using an objectid, if the item has a object_transcript value, the view transcript button will automatically be added. The transcript option allows you to manually add a different transcript or provide one for non-collection videos. (optional) Note: if you have issues make sure the item is a audio item. Audio file may not play correctly from dev server on Chrome browser! It will work in production. {% endcomment %} {% if include.objectid contains "/" %} {%- capture src -%}{{ include.objectid | relative_url }}{%- endcapture -%} {%- capture audio_link -%}{{ src }}{%- endcapture -%} {%- capture audio_caption -%}{{ include.caption }}{%- endcapture -%} {%- capture audio_title -%}{{ include.title }}{%- endcapture -%} {% capture audio_transcript %}{{ include.transcript }}{% endcapture %} {% capture audio_poster %}{% if include.image == false %}{% else %}{{ include.image | relative_url | default: '' }}{% endif %}{% endcapture %} {% else %} {%- assign item = site.data[site.metadata] | where: "objectid", include.objectid | first -%} {%- capture audio_link -%}{{ '/items/' | relative_url }}{% if item.parentid %}{{ item.parentid }}.html#{{ item.objectid }}{% else %}{{ item.objectid }}.html{% endif %}{%- endcapture -%} {%- capture src -%}{{ item.object_location | relative_url }}{% endcapture %} {%- capture audio_caption -%}{% if include.caption %}{{ include.caption }}{% else %}{{ item.description }}{% endif %}{%- endcapture -%} {%- capture audio_title -%}{% if include.title %}{{ include.title }}{% else %}{{ item.title }}{% endif %}{%- endcapture -%} {% capture audio_transcript %}{{ include.transcript | default: item.object_transcript }}{% endcapture %} {% capture audio_poster %}{% if include.image == false %}{% else %}{{ include.image | default: item.image_small | relative_url | default: '' }}{% endif %}{% endcapture %} {% endif %} {% capture includeid %}{% if include.objectid.size > 10 %}{{ include.objectid | slice: -10, 10 | slugify }}{% else %}{{ include.objectid | slugify }}{% endif %}{% endcapture %}
{{ audio_caption }}