fix: Changed naming in podcast makros because a podcast is not a blog.

This commit is contained in:
muli 2022-08-24 22:19:50 +02:00 committed by Gitea
parent fdf832f43f
commit a6fb09985b
3 changed files with 28 additions and 28 deletions

View File

@ -1,23 +1,23 @@
{% macro render_blog_post(post, from_index=false, section_class='-odd') %}
{% macro render_podcast_episode(episode, from_index=false, section_class='-odd') %}
<section class="content {{ section_class }}">
<div class="content__box -heading">
<div class="content__inner_box">
{% if from_index %}
<h2><a class="content__blog_link {{ section_class }}" href="{{ post|url }}">{{ post.title }}</a></h2>
<h2><a class="content__blog_link {{ section_class }}" href="{{ episode|url }}">{{ episode.title }}</a></h2>
{% else %}
<h2>{{ post.title }}</h2>
<h2>{{ episode.title }}</h2>
{% endif %}
<hr class="{{ section_class }}">
<p class="content__meta">
<i>geschrieben von {{ post.authors }} am {{ post.pub_date }}</i>
<i>geschrieben von {{ episode.authors }} am {{ episode.pub_date }}</i>
</p>
</div>
</div>
<div class="content__half_box">
<div class="content__inner_half_box">
{{ post.podcast_teaser }}
{{ episode.podcast_teaser }}
{% if not from_index %}
{{ post.podcast_shownotes }}
{{ episode.podcast_shownotes }}
{% endif %}
</div>
@ -25,44 +25,44 @@
<div class="content__inner_half_box">
<div class="pod_ctrl_box">
<audio controls class="pod_ctrl_box__audio_controls">
{% if post.podcastogg -%}
<source src="{{ post|url(alt='de')}}{{ post.podcastogg }}" type="audio/ogg">
{% if episode.podcastogg -%}
<source src="{{ episode|url(alt='de')}}{{ episode.podcastogg }}" type="audio/ogg">
{%- endif %}
{% if post.podcastmp3 -%}
<source src="{{ post|url(alt='de') }}{{ post.podcastmp3 }}" type="audio/mpeg">
{% if episode.podcastmp3 -%}
<source src="{{ episode|url(alt='de') }}{{ episode.podcastmp3 }}" type="audio/mpeg">
{%- endif %}
Your browser does not support the audio element.
</audio>
<div class="pod_ctrl_box__button">
<a class="pod_ctrl_box__button_link" href="{{ post|url }}" >Podcastfolge durchst&ouml;bern</a>
<a class="pod_ctrl_box__button_link" href="{{ episode|url }}" >Podcastfolge durchst&ouml;bern</a>
</div>
</div>
{% else -%}
<div class="content__inner_half_box">
<audio controls>
{% if post.podcastogg -%}
<source src="{{ post.podcastogg|url(alt='de') }}" type="audio/ogg">
{% if episode.podcastogg -%}
<source src="{{ episode.podcastogg|url(alt='de') }}" type="audio/ogg">
{%- endif %}
{% if post.podcastmp3 %}
<source src="{{ post.podcastmp3|url(alt='de') }}" type="audio/mpeg">
{% if episode.podcastmp3 %}
<source src="{{ episode.podcastmp3|url(alt='de') }}" type="audio/mpeg">
{%- endif %}
Your browser does not support the audio element.
</audio>
<br/>
{% if post.podcastmp3 -%}
<a class="" href="{{ post.podcastmp3|url(alt='de') }}" download>
{%- if post.podcasttitle -%}
{{ post.podcasttitle }}
{% if episode.podcastmp3 -%}
<a class="" href="{{ episode.podcastmp3|url(alt='de') }}" download>
{%- if episode.podcasttitle -%}
{{ episode.podcasttitle }}
{%- else -%}
Download Folge
{%- endif -%}
{{ ' als MP3' }}
</a>
{% endif %}
{% if post.podcastogg -%}
<a class="" href="{{ post.podcastogg|url(alt='de') }}" download>
{%- if post.podcasttitle -%}
{{ post.podcasttitle }}
{% if episode.podcastogg -%}
<a class="" href="{{ episode.podcastogg|url(alt='de') }}" download>
{%- if episode.podcasttitle -%}
{{ episode.podcasttitle }}
{%- else -%}
Download Folge
{%- endif -%}

View File

@ -1,5 +1,5 @@
{% extends "header_slim.html" %}
{% from "macros/podcast.html" import render_blog_post %}
{% from "macros/podcast.html" import render_podcast_episode %}
{%- block title -%}{{ this.title }}{%- endblock -%}
{%- block meta_description -%}
{%- if this.meta_description is defined and this.meta_description != "" -%}
@ -14,5 +14,5 @@
<h1>{{ this.title }}</h1>
</div>
</div>
{{ render_blog_post(this) }}
{{ render_podcast_episode(this) }}
{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends "header_slim.html" %}
{% from "macros/podcast.html" import render_blog_post %}
{% from "macros/podcast.html" import render_podcast_episode %}
{% from "macros/pagination.html" import render_pagination %}
{%- block title -%}{{ this.title }}{%- endblock -%}
@ -45,8 +45,8 @@
{#- Die Podcast Folgen werden aus dem blog template importiert :P -#}
{% for blog_post in this.pagination.items %}
{{ render_blog_post(blog_post, from_index=true) }}
{% for episode in this.pagination.items %}
{{ render_podcast_episode(episode, from_index=true) }}
{% endfor %}
<section>
{{ render_pagination(this.pagination, true) }}