site/templates/podlove-player.html
Simon Bruder 4972e93119
Do not include episode number in title
It confuses many people what SCH001 means and it also looks somewhat
weird, especially since we do not refer to the episode numbers.
2022-01-06 19:46:02 +01:00

73 lines
2.9 KiB
HTML

{%- if page.extra.episode is defined %}
{%- 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>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": {{ page.title | 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": {{ get_url(path="assets/poster.jpg") | safe | 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 %}
],
"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 %}