mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-07 17:12:27 +00:00
Switch themes to minimo
This commit is contained in:
46
themes/minimo/layouts/partials/nav/entry_nav.html
Normal file
46
themes/minimo/layouts/partials/nav/entry_nav.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{- $config := ( .Site.Params.settings.hideEntryNavigation ) -}}
|
||||
{{- $configType := ( printf "%T" $config ) -}}
|
||||
|
||||
{{- if ( eq $configType "bool" ) -}}
|
||||
{{- $.Scratch.Set "showEntryNav" ( not $config ) -}}
|
||||
{{- else -}}
|
||||
{{- $.Scratch.Set "showEntryNav" ( not ( in $config .Section ) ) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if ( $.Scratch.Get "showEntryNav" ) -}}
|
||||
|
||||
{{ if gt ( len ( where .Site.RegularPages "Section" .Section ) ) 1 }}
|
||||
<nav class='entry-nav'>
|
||||
<div class='container'>
|
||||
|
||||
{{- if .PrevInSection -}}
|
||||
<div class='prev-entry sep-before'>
|
||||
<a href='{{ .PrevInSection.Permalink | relURL }}'>
|
||||
<span aria-hidden='true'>
|
||||
{{- partial "svg/icon" "prev" -}}
|
||||
{{- print " " ( i18n "previous" ) -}}
|
||||
</span>
|
||||
<span class='screen-reader-text'>{{ i18n "previousPost" }}: </span>
|
||||
{{- .PrevInSection.Title -}}
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
{{- if .NextInSection -}}
|
||||
<div class='next-entry sep-before'>
|
||||
<a href='{{ .NextInSection.Permalink | relURL }}'>
|
||||
<span class='screen-reader-text'>{{ i18n "nextPost" }}: </span>
|
||||
{{- .NextInSection.Title -}}
|
||||
<span aria-hidden='true'>
|
||||
{{- print ( i18n "next" ) " " -}}
|
||||
{{- partial "svg/icon" "next" -}}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
||||
{{- end -}}
|
25
themes/minimo/layouts/partials/nav/menus/main.html
Normal file
25
themes/minimo/layouts/partials/nav/menus/main.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- if not .Site.Params.settings.hideMainMenu -}}
|
||||
|
||||
<nav id='main-menu' class='menu main-menu' aria-label='{{ i18n "mainMenu" }}'>
|
||||
<div class='container'>
|
||||
{{ partial "sidebar/toggler" . }}
|
||||
<ul>
|
||||
{{- range .Site.Menus.main -}}
|
||||
{{- $isCurrent := ( or ( $.IsMenuCurrent "main" . ) ( $.HasMenuCurrent "main" . ) ) -}}
|
||||
<li class='item {{- if $isCurrent }} current {{- end -}}'>
|
||||
<a {{ if $isCurrent -}} aria-current='page' {{ end -}} href='{{ .URL }}'>
|
||||
{{- with .Pre -}}{{- . -}}{{- end -}}
|
||||
{{- .Name -}}
|
||||
{{- with .Post -}}{{- . -}}{{- end -}}
|
||||
</a>
|
||||
</li>
|
||||
{{- end -}}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{{- else -}}
|
||||
|
||||
{{ partial "sidebar/toggler" . }}
|
||||
|
||||
{{- end -}}
|
46
themes/minimo/layouts/partials/nav/pagination.html
Normal file
46
themes/minimo/layouts/partials/nav/pagination.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{ if gt .Paginator.TotalPages 1 }}
|
||||
<nav id='pagination'>
|
||||
<div class='page-links'>
|
||||
|
||||
{{ with .Paginator.Prev }}
|
||||
<a class='page-link prev' href='{{ .URL }}'>
|
||||
{{- partial "svg/icon" "prev" -}}
|
||||
<span class='screen-reader-text'>{{ i18n "previousPage" }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
{{- $.Scratch.Set "hasPrevDots" false -}}
|
||||
{{- $.Scratch.Set "hasNextDots" false -}}
|
||||
|
||||
{{ range .Paginator.Pagers }}
|
||||
{{ if ( eq . $.Paginator ) }}
|
||||
<span aria-current='page' class='page-link current'>
|
||||
<span class='screen-reader-text'>{{ i18n "currentPage" }}: </span>
|
||||
{{- .PageNumber -}}
|
||||
</span>
|
||||
{{ else if or ( or ( eq . $.Paginator.First ) ( eq . $.Paginator.Prev ) ) ( or ( eq . $.Paginator.Next ) ( eq . $.Paginator.Last ) ) }}
|
||||
<a class='page-link' href='{{ .URL }}'>
|
||||
<span class='screen-reader-text'>{{ i18n "page" }}: </span>
|
||||
{{- .PageNumber -}}
|
||||
</a>
|
||||
{{ else }}
|
||||
{{ if and ( not ( $.Scratch.Get "hasPrevDots" ) ) ( lt .PageNumber $.Paginator.PageNumber ) }}
|
||||
{{- $.Scratch.Set "hasPrevDots" true -}}
|
||||
<span class='page-link dots'>…</span>
|
||||
{{ else if and ( not ( $.Scratch.Get "hasNextDots" ) ) ( gt .PageNumber $.Paginator.PageNumber ) }}
|
||||
{{- $.Scratch.Set "hasNextDots" true -}}
|
||||
<span class='page-link dots'>…</span>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Paginator.Next }}
|
||||
<a class='page-link next' href='{{ .URL }}'>
|
||||
<span class='screen-reader-text'>{{ i18n "nextPage" }}</span>
|
||||
{{- partial "svg/icon" "next" -}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
{{ end }}
|
Reference in New Issue
Block a user