diff options
| author | Eltrac <hi@guhub.cn> | 2025-04-29 14:01:21 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-04-29 14:01:21 +0800 |
| commit | 8e7bf0f70127eff912e3822b7a4956e5bdc9522a (patch) | |
| tree | 5caf2f848b7c6c8483d2528bdf9fb15eb2bef99a /layouts/posts | |
| parent | b197beb420982af58d964bf9194dc89a1c7cd4da (diff) | |
feat: post bottom navigation
allow users to navigate between posts in a timeline order
Former-commit-id: 0cdd86faae1075f08f7493e5f2e8635fbb9577de
Diffstat (limited to 'layouts/posts')
| -rw-r--r-- | layouts/posts/single.html | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 32c58a78..bb0daca8 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -70,6 +70,19 @@ </div> {{ end }} + <!-- Post Bottom Navigation --> + <nav class="post-bottom-navigation"> + <ul> + {{ if .NextInSection }} + <li><a href="{{ .NextInSection.RelPermalink }}" data-umami-event="Click Next Post">← {{ .NextInSection.Title }}</a></li> + {{ else }}<li class="placeholder"></li>{{ end }} + <li style="place-self: center;"><a href="{{ .Site.LanguagePrefix }}/">{{ T "backToHome" }}</a></li> + {{ if .PrevInSection }} + <li><a href="{{ .PrevInSection.RelPermalink }}" data-umami-event="Click Previous Post">{{ .PrevInSection.Title }} →</a></li> + {{ else }}<li class="placeholder"></li>{{ end }} + </ul> + </nav> + <script src="/js/tocbot.min.js"></script> <script> tocbot.init({ |
