fix: hide post navigation when no adjacent posts exist
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
This commit is contained in:
42
post.hbs
42
post.hbs
@@ -50,24 +50,38 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{!-- Next/Prev Navigation --}}
|
{{!-- Next/Prev Navigation --}}
|
||||||
<nav class="mt-16 grid grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--bg-tertiary)] pt-12">
|
{{#next_post}}
|
||||||
<div class="prev-post-nav">
|
<nav class="mt-16 grid grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--bg-tertiary)] pt-12">
|
||||||
{{#prev_post}}
|
<div class="prev-post-nav">
|
||||||
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
{{#../prev_post}}
|
||||||
<span class="text-xs uppercase tracking-widest text-[var(--text-tertiary)] mb-2 block">← Previous Post</span>
|
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
||||||
<h4 class="text-xl font-bold group-hover:text-[var(--brand-primary)] transition-colors duration-300">{{title}}</h4>
|
<span class="text-xs uppercase tracking-widest text-[var(--text-tertiary)] mb-2 block">← Previous Post</span>
|
||||||
</a>
|
<h4 class="text-xl font-bold group-hover:text-[var(--brand-primary)] transition-colors duration-300">{{title}}</h4>
|
||||||
{{/prev_post}}
|
</a>
|
||||||
</div>
|
{{/../prev_post}}
|
||||||
<div class="next-post-nav md:text-right">
|
</div>
|
||||||
{{#next_post}}
|
<div class="next-post-nav md:text-right">
|
||||||
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
||||||
<span class="text-xs uppercase tracking-widest text-[var(--text-tertiary)] mb-2 block">Next Post →</span>
|
<span class="text-xs uppercase tracking-widest text-[var(--text-tertiary)] mb-2 block">Next Post →</span>
|
||||||
<h4 class="text-xl font-bold group-hover:text-[var(--brand-primary)] transition-colors duration-300">{{title}}</h4>
|
<h4 class="text-xl font-bold group-hover:text-[var(--brand-primary)] transition-colors duration-300">{{title}}</h4>
|
||||||
</a>
|
</a>
|
||||||
{{/next_post}}
|
</div>
|
||||||
</div>
|
</nav>
|
||||||
</nav>
|
{{else}}
|
||||||
|
{{#prev_post}}
|
||||||
|
<nav class="mt-16 grid grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--bg-tertiary)] pt-12">
|
||||||
|
<div class="prev-post-nav">
|
||||||
|
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
||||||
|
<span class="text-xs uppercase tracking-widest text-[var(--text-tertiary)] mb-2 block">← Previous Post</span>
|
||||||
|
<h4 class="text-xl font-bold group-hover:text-[var(--brand-primary)] transition-colors duration-300">{{title}}</h4>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="next-post-nav md:text-right">
|
||||||
|
{{!-- No next post --}}
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
{{/prev_post}}
|
||||||
|
{{/next_post}}
|
||||||
{{/is}}
|
{{/is}}
|
||||||
|
|
||||||
{{#is "post"}}
|
{{#is "post"}}
|
||||||
|
|||||||
Reference in New Issue
Block a user