1
0
Fork 0
mirror of https://github.com/safing/web synced 2025-04-17 17:39:08 +00:00

Fix next/previous items to show what category it is

I do not know if one can scope the built in next/previous module - will be a task for later
This commit is contained in:
davegson 2021-03-26 09:40:38 +01:00
parent cee152b612
commit e3bb046363
4 changed files with 31 additions and 69 deletions

View file

@ -0,0 +1,28 @@
<div class="flex pt-24 justify-center grid grid-rows-2 grid-cols-2 row-gap-12 md:grid-rows-1 md:row-gap-0 md:col-gap-16 max-w-3xl mx-auto">
{% if page.next.url %}
<div class="text-left row-start-1 row-end-2 col-start-1 col-end-3 md:row-auto md:col-auto">
{% if page.next.category == "blog" %}
{% assign next_type = "Blog Post" %}
{% elsif page.next.category == "video" %}
{% assign next_type = "Video" %}
{% elsif page.next.category == "podcast" %}
{% assign next_type = "Podcast" %}
{% endif %}
<div class="pb-4 text-md opacity-55">Next {{ next_type }}</div>
<a href="{{ page.next.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{ page.next.title }}</a>
</div>
{% endif %}
{% if page.previous.url %}
<div class="text-right row-start-2 row-end-3 col-start-1 md:col-start-2 col-end-3 md:row-auto">
{% if page.previous.category == "blog" %}
{% assign previous_type = "Blog Post" %}
{% elsif page.previous.category == "video" %}
{% assign previous_type = "Video" %}
{% elsif page.previous.category == "podcast" %}
{% assign previous_type = "Podcast" %}
{% endif %}
<div class="pb-4 text-md opacity-55">Previous {{ previous_type }}</div>
<a href="{{ page.previous.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{ page.previous.title }}</a>
</div>
{% endif %}
</div>

View file

@ -26,44 +26,4 @@ layout: page_container
{{ content | replace: '<!--break-->', '<a class="anchor" id="continue"></a>' }}
</div>
{% if site.inter_post_navigation == true %}
<section class="post-navigation">
<span class="prev-post">
{% if page.previous.url %}
<a href="{{page.previous.url | prepend: site.base_url}}">
<span class="fa-stack fa-lg">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-angle-double-left fa-stack-1x fa-inverse"></i>
</span>
<span class="page-number">{{page.previous.title}}</span>
</a>
{% endif %}
</span>
<span class="next-post">
{% if page.next.url %}
<a href="{{page.next.url | prepend: site.base_url}}">
<span class="page-number">{{page.next.title}}</span>
<span class="fa-stack fa-lg">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-angle-double-right fa-stack-1x fa-inverse"></i>
</span>
</a>
{% endif %}
</span>
</section>
{% endif %}
<div class="flex pt-24 justify-center grid grid-rows-2 grid-cols-2 row-gap-12 md:grid-rows-1 md:row-gap-0 md:col-gap-16 max-w-3xl mx-auto">
{% if page.next.url %}
<div class="text-left row-start-1 row-end-2 col-start-1 col-end-3 md:row-auto md:col-auto">
<div class="pb-4 text-md opacity-55">Next Post</div>
<a href="{{page.next.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.next.title}}</a>
</div>
{% endif %}
{% if page.previous.url %}
<div class="text-right row-start-2 row-end-3 col-start-1 md:col-start-2 col-end-3 md:row-auto">
<div class="pb-4 text-md opacity-55">Previous Post</div>
<a href="{{page.previous.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.previous.title}}</a>
</div>
{% endif %}
</div>
{% include next_previous_item.html %}

View file

@ -25,17 +25,4 @@ container_class: "podcast pt-40 lg:pt-40"
<h3>Description</h3>
{{ page.summary }}
<div class="flex pt-24 justify-center grid grid-cols-2 col-gap-16 max-w-3xl mx-auto">
{% if page.next.url %}
<div class="text-left">
<div class="pb-4 text-md opacity-55">Next Podcast</div>
<a href="{{page.next.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.next.title}}</a>
</div>
{% endif %}
{% if page.previous.url %}
<div class="text-right">
<div class="pb-4 text-md opacity-55">Previous Podcast</div>
<a href="{{page.previous.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.previous.title}}</a>
</div>
{% endif %}
</div>
{% include next_previous_item.html %}

View file

@ -24,17 +24,4 @@ container_class: "podcast pt-40 lg:pt-64"
{{ content }}
</div>
<div class="flex pt-24 justify-center grid grid-cols-2 col-gap-16 max-w-3xl mx-auto">
{% if page.next.url %}
<div class="text-left">
<div class="pb-4 text-md opacity-55">Next Post</div>
<a href="{{page.next.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.next.title}}</a>
</div>
{% endif %}
{% if page.previous.url %}
<div class="text-right col-start-2">
<div class="pb-4 text-md opacity-55">Previous Post</div>
<a href="{{page.previous.url }}" class="text-3xl tracking-tight font-extrabold leading-none break-normal">{{page.previous.title}}</a>
</div>
{% endif %}
</div>
{% include next_previous_item.html %}