add post-description post-nav and related-posts

This commit is contained in:
geekifan
2025-04-22 13:46:12 +08:00
parent d24c640ab7
commit b0c293efcd
3 changed files with 148 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<nav class="post-navigation d-flex justify-content-between" aria-label="Post Navigation">
{{ $previous := i18n "post.button.previous" }}
{{ $next := i18n "post.button.next" }}
{{ with .PrevInSection }}
<a
href="{{ .RelPermalink }}"
class="btn btn-outline-primary"
aria-label="{{ $previous }}"
>
<p>{{ .Title }}</p>
</a>
{{ else }}
<div class="btn btn-outline-primary disabled" aria-label="{{ $previous }}">
<p>-</p>
</div>
{{ end }}
{{ with .NextInSection }}
<a
href="{{ .RelPermalink }}"
class="btn btn-outline-primary"
aria-label="{{ $next }}"
>
<p>{{ .Title }}</p>
</a>
{{ else }}
<div class="btn btn-outline-primary disabled" aria-label="{{ $next }}">
<p>-</p>
</div>
{{ end }}
</nav>