diff --git a/layouts/notes/list.html b/layouts/notes/list.html index f381b6c..f8181c7 100644 --- a/layouts/notes/list.html +++ b/layouts/notes/list.html @@ -40,7 +40,14 @@
- {{ partial "note-aggregator.html" . }} + {{ $paginator := .Paginate .RegularPagesRecursive 10 }} + {{ range $paginator.Pages }} + {{ if .Layout }} + {{/* ignore search.md file*/}} + {{ else }} + {{ .Content }} + {{ end }} + {{ end }}
{{ template "_internal/pagination.html" . }} @@ -51,6 +58,8 @@ {{ define "scripts" }} + + diff --git a/layouts/notes/single.html b/layouts/notes/single.html index b35edb6..152cb52 100644 --- a/layouts/notes/single.html +++ b/layouts/notes/single.html @@ -40,9 +40,7 @@
-
- {{ .Content }} -
+ {{ .Content }}
@@ -50,6 +48,8 @@ {{ define "scripts" }} + + diff --git a/layouts/partials/helpers/add-navbar-separator.html b/layouts/partials/helpers/add-navbar-separator.html new file mode 100644 index 0000000..6fb280e --- /dev/null +++ b/layouts/partials/helpers/add-navbar-separator.html @@ -0,0 +1,25 @@ +{{ $addNavbarSeparator:= false }} + +{{/* If "blog" feature is enabled, then add navbar separator */}} +{{ if site.Params.features.blog.enable }} + {{ $addNavbarSeparator = true }} +{{ end }} + +{{/* If "notes" feature is enabled, then add navbar separator */}} +{{ if site.Params.features.notes.enable }} + {{ $addNavbarSeparator = true }} +{{ end }} + +{{/* If site has custom menus, then add navbar separator */}} +{{ $customMenus := site.Params.customMenus }} +{{ if (index site.Data site.Language.Lang).site.customMenus }} + {{ $customMenus = (index site.Data site.Language.Lang).site.customMenus }} +{{ end }} + +{{ if $customMenus }} + {{ if gt (len $customMenus) 0 }} + {{ $addNavbarSeparator = true }} + {{ end }} +{{ end }} + +{{ return $addNavbarSeparator }} diff --git a/layouts/partials/navigators/navbar.html b/layouts/partials/navigators/navbar.html index 2daae09..df29cdc 100644 --- a/layouts/partials/navigators/navbar.html +++ b/layouts/partials/navigators/navbar.html @@ -1,3 +1,12 @@ +{{/* variables for enabling/disabling various features */}} +{{ $blogEnabled := site.Params.features.blog.enable | default false }} +{{ $notesEnabled := site.Params.features.notes.enable | default false }} + +{{/* keep backward compatibility for blog post */}} +{{ if site.Params.enableBlogPost }} + {{ $blogEnabled = true }} +{{ end }} + {{/* default logos */}} {{ $mainLogo := "/images/main-logo.png" }} {{ $invertedLogo := "/images/inverted-logo.png" }} @@ -84,20 +93,20 @@ {{ end }} {{- end }} - {{ $hasCustomMenus:= false }} - {{ if $customMenus }} - {{ if gt (len $customMenus) 0 }} - {{ $hasCustomMenus = true }} - {{ end }} - {{ end }} - {{ if (or site.Params.enableBlogPost $hasCustomMenus) }} + {{ $shouldAddSeparator:= partial "helpers/add-navbar-separator.html" . }} + {{ if $shouldAddSeparator }} {{ end }} - {{ if site.Params.enableBlogPost }} + {{ if $blogEnabled }} {{ end }} + {{ if $notesEnabled }} + + {{ end }} {{ range $customMenus }}