diff options
author | matsuyoshi <sfbgwm30@gmail.com> | 2022-03-21 15:34:57 +0300 |
---|---|---|
committer | matsuyoshi <sfbgwm30@gmail.com> | 2022-03-21 15:34:57 +0300 |
commit | 0d09ed0cd380c57b430f37736df6620ec0a5ab0f (patch) | |
tree | f4d35c12b3f72256868326148639ff59886a6c4f | |
parent | 65e249b95203e6176bfa6bb25a30cfef6867dc89 (diff) |
Add support for bottom navigation for single page
-rw-r--r-- | assets/css/main.css | 24 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/partials/bottomnav.html | 22 |
3 files changed, 48 insertions, 0 deletions
diff --git a/assets/css/main.css b/assets/css/main.css index 9cfc888..a5a2993 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -418,6 +418,30 @@ mark { background-color: #eeff00; } +.bottomnav { + list-style: none; + text-align: center; + padding-left: 0; +} + +.bottomnav ul { + display: block; +} + +.bottomnav li { + display: inline; +} + +.bottomnav .previous > a { + float: left; + display: block; +} + +.bottomnav .next > a { + float: right; + display: block; +} + .pager { list-style: none; text-align: center; diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ceeb928..7bf379e 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -13,6 +13,8 @@ {{ end }} </div> {{ end }} + + {{ partial "bottomnav.html" . }} </article> {{ if and (gt .WordCount 400) (.Param "backtotop") }} <button onclick="topFunction()" id="backtotopButton"> diff --git a/layouts/partials/bottomnav.html b/layouts/partials/bottomnav.html new file mode 100644 index 0000000..80ac689 --- /dev/null +++ b/layouts/partials/bottomnav.html @@ -0,0 +1,22 @@ +<ul class="bottomnav"> + {{- with .NextInSection -}} + <li class="previous"> + {{- $title := .Title | safeHTML -}} + {{- if $title -}} + <a href="{{- .RelPermalink -}}" + ><span><< </span>{{- $title | truncate 20 -}}</a + >{{- end -}} + + </li> + {{- end -}} + {{- with .PrevInSection -}} + <li class="next"> + {{- $title := .Title | safeHTML -}} + {{- if $title -}} + <a href="{{- .RelPermalink -}}" + >{{- $title | truncate 20 -}}<span> >></span></a + >{{- end -}} + + </li> + {{- end -}} +</ul> |