Create thumbnail partials for blogs and pods

This commit is contained in:
davegson 2020-07-02 17:53:53 +02:00
parent b621c492ac
commit 04702390bb
4 changed files with 61 additions and 55 deletions

View file

@ -0,0 +1,27 @@
<li class="mt-10 md:mt-0">
<div class="block transform hover:scale-95 duration-150 ease-in-out">
<a href="{{ post.url }}">
<div class="relative" style="max-width: 365px;">
{% if post.custom_thumbnail_name == null %}
<img src="{{ site.img_url }}thumbnails/blog/placeholder.png">
{% else %}
<img src="{{ site.img_url }}thumbnails/blog/{{ post.custom_thumbnail_name }}.png">
{% endif %}
{% if post.progress_update == true %}
<span class="absolute text-white right-0 bottom-0 pr-3 pb-3" style="font-size: 3.1rem; font-weight: 800;" >#{{ post.title | slice: 2, 2 }}</span>
{% endif %}
</div>
<div class="pt-6">
<span class="opacity-25">
{{ post.date | date: "%-d. %b %Y" }}
</span>
{% if post.progress_update == true %}
{% assign title_length = post.title | size %}
<p>{{ post.title | slice: 7, title_length }} - #{{ post.title | slice: 2, 2 }}</p>
{% else %}
<p>{{ post.title }}</p>
{% endif %}
</div>
</a>
</div>
</li>

View file

@ -0,0 +1,32 @@
<li class="mt-10 md:mt-0">
<div class="block transform hover:scale-95 duration-150 ease-in-out">
<a href="{{ episode.url }}">
<div class="relative" style="max-width: 365px;">
{% if episode.custom_thumbnail_name == null %}
<img src="{{ site.img_url }}thumbnails/podcast/placeholder.png">
{% else %}
<img src="{{ site.img_url }}thumbnails/podcast/{{ episode.custom_thumbnail_name }}.png">
{% endif %}
<span class="absolute text-white right-0 bottom-0 pr-3 pb-3" style="font-size: 3.1rem; font-weight: 800;" >#{{ episode.title | slice: 2, 2 }}</span>
</div>
<span style="font-size: 12rem; font-weight: 800; margin-top: -13.8rem; margin-left: -0.8rem;" class=" z-0 absolute bg-top">
<button type="button" style="background-color: #6188ff;" class="inline-flex items-center px-3 py-3 rounded-md border border-transparent text-xs leading-5 font-extrabold text-white">
<svg class="h-8 w-auto lg:h-7" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g fill="none">
<path d="M0 0h24v24H0z"/>
<path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 15v0c-1.657 0-3-1.343-3-3V6c0-1.657 1.343-3 3-3v0c1.657 0 3 1.343 3 3v6c0 1.657-1.343 3-3 3z"/>
<path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M18 10v2c0 3.314-2.686 6-6 6v0c-3.314 0-6-2.686-6-6v-2M12 18v3M7.82 21h8.36"/>
</g>
</svg>
</button>
</span>
<div class="pt-6">
<span class="opacity-25">
{{ episode.date | date: "%-d. %b %Y" }}
</span>
{% assign title_length = episode.title | size %}
<p>{{ episode.title | slice: 7, title_length }} - #{{ episode.title | slice: 2, 2 }}</p>
</div>
</a>
</div>
</li>

View file

@ -17,31 +17,7 @@ layout: page
<div class="mt-8 md:mt-32">
<ul class="md:grid md:grid-cols-2 lg:grid-cols-3 md:col-gap-8 md:row-gap-10">
{% for post in site.posts %}
<li class="mt-10 md:mt-0">
<div class="block transform hover:scale-95 duration-150 ease-in-out">
<a href="{{ post.url }}">
<div class="relative" style="max-width: 365px;">
{% if post.custom_thumbnail_name == null %}
<img src="{{ site.img_url }}thumbnails/blog/placeholder.png">
{% else %}
<img src="{{ site.img_url }}thumbnails/blog/{{ post.custom_thumbnail_name }}.png">
{% endif %}
{% if post.progress_update == true %}
<span class="absolute text-white right-0 bottom-0 pr-3 pb-3" style="font-size: 3.1rem; font-weight: 800;" >#{{ post.title | slice: 2, 2 }}</span>
{% endif %}
</div>
<div class="pt-6">
<span class="opacity-25">{{ post.date | date: "%-d. %b %Y" }}</span>
{% if post.progress_update == true %}
{% assign title_length = post.title | size %}
<p>{{ post.title | slice: 7, title_length }} - #{{ post.title | slice: 2, 2 }}</p>
{% else %}
<p>{{ post.title }}</p>
{% endif %}
</div>
</a>
</div>
</li>
{% include thumbnail_blog.html %}
{% endfor %}
</ul>
<br class="mb-12">

View file

@ -26,36 +26,7 @@ layout: page
<ul class="md:grid md:grid-cols-2 lg:grid-cols-3 md:col-gap-8 md:row-gap-10">
{% assign sorted_podcasts = site.podcasts | reverse %}
{% for episode in sorted_podcasts %}
<li class="mt-10 md:mt-0">
<div class="block transform hover:scale-95 duration-150 ease-in-out">
<a href="{{ episode.url }}">
<div class="relative" style="max-width: 365px;">
{% if episode.custom_thumbnail_name == null %}
<img src="{{ site.img_url }}thumbnails/podcast/placeholder.png">
{% else %}
<img src="{{ site.img_url }}thumbnails/podcast/{{ episode.custom_thumbnail_name }}.png">
{% endif %}
<span class="absolute text-white right-0 bottom-0 pr-3 pb-3" style="font-size: 3.1rem; font-weight: 800;" >#{{ episode.title | slice: 2, 2 }}</span>
</div>
<span style="font-size: 12rem; font-weight: 800; margin-top: -13.8rem; margin-left: -0.8rem;" class=" z-0 absolute bg-top">
<button type="button" style="background-color: #6188ff;" class="inline-flex items-center px-3 py-3 rounded-md border border-transparent text-xs leading-5 font-extrabold text-white">
<svg class="h-8 w-auto lg:h-7" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g fill="none">
<path d="M0 0h24v24H0z"/>
<path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M12 15v0c-1.657 0-3-1.343-3-3V6c0-1.657 1.343-3 3-3v0c1.657 0 3 1.343 3 3v6c0 1.657-1.343 3-3 3z"/>
<path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.8" d="M18 10v2c0 3.314-2.686 6-6 6v0c-3.314 0-6-2.686-6-6v-2M12 18v3M7.82 21h8.36"/>
</g>
</svg>
</button>
</span>
<div class="pt-6">
<span class="opacity-25">{{ episode.date | date: "%-d. %b %Y" }}</span>
{% assign title_length = episode.title | size %}
<p>{{ episode.title | slice: 7, title_length }} - #{{ episode.title | slice: 2, 2 }}</p>
</div>
</a>
</div>
</li>
{% include thumbnail_podcast.html %}
{% endfor %}
</ul>
<br class="mb-12">