fix: refactor post navigation to avoid nested helpers and hide empty container
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:
20
post.hbs
20
post.hbs
@@ -50,8 +50,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{!-- Next/Prev Navigation --}}
|
{{!-- Next/Prev Navigation --}}
|
||||||
{{#next_post}}
|
<nav class="hidden has-[a]:grid mt-16 max-w-3xl mx-auto grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--bg-tertiary)] pt-12">
|
||||||
<nav class="mt-16 max-w-3xl mx-auto grid grid-cols-1 md:grid-cols-2 gap-4 border-t border-[var(--bg-tertiary)] pt-12">
|
|
||||||
{{#prev_post}}
|
{{#prev_post}}
|
||||||
<div class="prev-post-nav">
|
<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">
|
<a href="{{url}}" class="group block p-6 bg-[var(--bg-secondary)] rounded-lg hover:bg-[var(--bg-tertiary)] transition-all duration-300">
|
||||||
@@ -60,25 +59,16 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{/prev_post}}
|
{{/prev_post}}
|
||||||
<div class="next-post-nav md:text-right">
|
|
||||||
|
{{#next_post}}
|
||||||
|
<div class="next-post-nav md:text-right md:col-start-2">
|
||||||
<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>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
|
||||||
{{else}}
|
|
||||||
{{#prev_post}}
|
|
||||||
<nav class="mt-16 max-w-3xl mx-auto 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>
|
|
||||||
</nav>
|
|
||||||
{{/prev_post}}
|
|
||||||
{{/next_post}}
|
{{/next_post}}
|
||||||
|
</nav>
|
||||||
{{/is}}
|
{{/is}}
|
||||||
</article>
|
</article>
|
||||||
{{/post}}
|
{{/post}}
|
||||||
|
|||||||
Reference in New Issue
Block a user