diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b9d9f0fe..e2ff5a70 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -110,7 +110,7 @@ defaultContentLanguageInSubdir = false # Display comment count? Requires commenting to be enabled. comment_count = true - # Display section pager for posts? + # Display next/previous section pager? section_pager = false # Enable global LaTeX math rendering? diff --git a/i18n/en.yaml b/i18n/en.yaml index 366fdc12..ff197211 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -14,6 +14,12 @@ - id: minute_read translation: min read +- id: previous + translation: Previous + +- id: next + translation: Next + # Buttons - id: btn_preprint diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a628db23..ace5738f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -35,7 +35,7 @@ {{ end }} {{ if .Site.Params.section_pager }} -
+
{{ partial "section_pager.html" . }}
{{ end }} diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index 8c45c8d8..51b9262c 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -226,6 +226,39 @@ small, color: red; } +/************************************************* + * Pager. + **************************************************/ + +.post-nav { + margin-top: 1rem; + font-size: 0.8rem; +} + +.post-nav-item { + hyphens: auto; + word-wrap: break-word; + padding: 11px 0 12px; + width: 100%; +} + +.post-nav-item a { + color: #2b2b2b; + line-height: 1.7; + text-transform: none; +} + +.post-nav-item .meta-nav { + color: #767676; + font-weight: 900; + line-height: 2; + text-transform: uppercase; +} + +.dark .post-nav-item a { + color: #ddd; +} + /************************************************* * Home Sections **************************************************/ diff --git a/layouts/partials/section_pager.html b/layouts/partials/section_pager.html index 02093764..a3cc8d0a 100644 --- a/layouts/partials/section_pager.html +++ b/layouts/partials/section_pager.html @@ -1,13 +1,14 @@ - +
+ {{if .NextInSection}} +
+
{{ i18n "next" }}
+ +
+ {{end}} + {{if .PrevInSection}} +
+
{{ i18n "previous" }}
+ +
+ {{end}} +
diff --git a/layouts/project/single.html b/layouts/project/single.html index e9c6eb11..0f8603f0 100644 --- a/layouts/project/single.html +++ b/layouts/project/single.html @@ -62,9 +62,11 @@
-
+{{ if .Site.Params.section_pager }} +
{{ partial "section_pager.html" . }}
+{{ end }} {{ partial "footer_container.html" . }} {{ partial "footer.html" . }} diff --git a/layouts/publication/single.html b/layouts/publication/single.html index e6eaa94d..25077621 100644 --- a/layouts/publication/single.html +++ b/layouts/publication/single.html @@ -100,9 +100,11 @@
-
+{{ if .Site.Params.section_pager }} +
{{ partial "section_pager.html" . }}
+{{ end }} {{ partial "footer_container.html" . }} {{ partial "footer.html" . }} diff --git a/layouts/talk/single.html b/layouts/talk/single.html index 326b9c25..1c6d398a 100644 --- a/layouts/talk/single.html +++ b/layouts/talk/single.html @@ -107,9 +107,11 @@
-
+{{ if .Site.Params.section_pager }} +
{{ partial "section_pager.html" . }}
+{{ end }} {{ partial "footer_container.html" . }} {{ partial "footer.html" . }}