From 5e993f57401dd4fd6666b1ecea8b3717259ba18b Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Tue, 30 Jun 2020 01:30:59 +0600 Subject: [PATCH] Fix next-prev navigator --- layouts/_default/single.html | 26 +---------------- layouts/partials/next-prev-navigator.html | 35 +++++++++++++++++++++++ 2 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 layouts/partials/next-prev-navigator.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 20558ba..a5e7454 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -44,31 +44,7 @@
-
- {{ $currentPage := . }} - {{ range (where site.RegularPages.ByDate "Type" "in" site.Params.mainSections )}} - {{ if eq .RelPermalink $currentPage.RelPermalink }} - {{ if in site.Params.mainSections .Next.Type }} - - {{ end }} - {{ if in site.Params.mainSections .Prev.Type }} - - {{ end }} - {{ end }} - {{ end }} -
+ {{ partial "next-prev-navigator.html" . }}
{{ if .Site.DisqusShortname }} diff --git a/layouts/partials/next-prev-navigator.html b/layouts/partials/next-prev-navigator.html new file mode 100644 index 0000000..eca6632 --- /dev/null +++ b/layouts/partials/next-prev-navigator.html @@ -0,0 +1,35 @@ +
+{{ $currentPage := . }} +{{ range (where site.RegularPages.ByDate "Type" "in" site.Params.mainSections )}} + {{ if eq .RelPermalink $currentPage.RelPermalink }} + {{ if .Next }} + {{ if (in site.Params.mainSections .Next.Type) }} + + {{ end }} + {{ end }} + {{ if .Prev }} + {{ if (in site.Params.mainSections .Prev.Type) }} + {{ $columnWidth:="col-md-12" }} + {{ if .Next }} + {{ if (in site.Params.mainSections .Next.Type) }} + {{ $columnWidth = "col-md-6" }} + {{ end }} + {{ end}} + + {{ end }} + {{ end }} + {{ end }} +{{ end }} +