site/templates/podlove-player.html

81 lines
3.1 KiB
HTML
Raw Normal View History

2020-08-11 16:14:38 +02:00
{%- if page.extra.episode %}
{%- set episodes = load_data(path="static/episodes.json") -%}
<div class="podlove-player" id="podlove-player-{{ page.slug }}" data-id="{{ page.slug }}">
<audio controls preload="none">
{%- for format in config.extra.formats %}
<source src="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | safe }}" type="{{ format.mime_type | safe }}">
{%- endfor %}
</audio>
<h4>Download</h4>
<ul>
{%- for format in config.extra.formats %}
<li><a href="{{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | safe }}">{{ format.name }} ({{ episodes[page.slug].formats[format.ext].size | filesizeformat }})</a></li>
{%- endfor %}
</ul>
<h4>Kapitel</h4>
<p>
{%- for chapter in episodes[page.slug].chapters %}
<strong>{{ chapter.start }}:</strong> {{ chapter.title }}<br/>
{%- endfor %}
</p>
<h4>Mitwirkende</h4>
<ul>
{%- for contributor in page.extra.contributors %}
<li>{{ contributor | json_encode | safe }}</li>
{%- endfor %}
</ul>
</div>
<script id="config-episode-{{ page.slug }}" type="application/json">
{
"title": {{ macros::title(page=page) | json_encode | safe }},
"subtitle": {{ page.extra.subtitle | default(value="") | json_encode | safe }},
"summary": {{ page.description | json_encode | safe }},
"publicationDate": {{ page.date | date(format="%+") | json_encode | safe }},
"poster": {{ macros::poster(page=page) | json_encode | safe }},
"duration": {{ episodes[page.slug].duration | json_encode | safe }},
"link": {{ page.permalink | json_encode | safe }},
"show": {
"title": {{ config.title | json_encode | safe }},
"subtitle": {{ config.extra.subtitle | json_encode | safe }},
"summary": {{ config.description | json_encode | safe }},
"poster": {{ get_url(path="assets/poster.jpg") | json_encode | safe }},
"link": {{ config.base_url | json_encode | safe }}
},
"audio": [
{%- for format in config.extra.formats %}
{
"url": {{ get_url(path="episodes/" ~ page.slug ~ "." ~ format.ext) | json_encode | safe }},
"mimeType": {{ format.mime_type | json_encode | safe }},
"title": {{ format.name | json_encode | safe }},
"size": {{ episodes[page.slug].formats[format.ext].size }}
}{% if not loop.last %},{% endif %}
{%- endfor %}
],
"chapters": {{ episodes[page.slug].chapters | json_encode | safe }},
"contributors": [
{%- for contributor in page.extra.contributors %}
{
"name": {{ contributor | json_encode | safe }},
"avatar": {{ get_url(path="assets/avatar.svg") | json_encode | safe }}
}{% if not loop.last %},{% endif %}
{%- endfor %}
],
"reference": {
"base": {{ get_url(path="vendor/podlove-web-player/", trailing_slash=true) | json_encode | safe }},
"config": {{ get_url(path="episodes/" ~ page.slug ~ ".podlove.json") | json_encode | safe }},
"share": {{ get_url(path="vendor/podlove-web-player/share.html") | json_encode | safe }}
},
"theme": {
"main": {{ config.extra.theme.main | default(value="#2B8AC6") | json_encode | safe }},
"highlight": {{ config.extra.theme.highlight | default(value="") | json_encode | safe }}
}
}
</script>
{%- endif %}