diff options
author | mms <michal@sapka.me> | 2024-04-11 23:08:31 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-04-11 23:08:31 +0200 |
commit | 0cd6d6091d52d6e085d642d89781313d570fc1dd (patch) | |
tree | c79653dd1d5a7fcc74d31d1823b42a2598c3e709 /layouts | |
parent | 7ebd51b310a14a1e4fadf45b3e7268c0c289ccce (diff) |
feat: breadcrumbs
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/baseof.html | 29 | ||||
-rw-r--r-- | layouts/partials/back_nav.html | 25 | ||||
-rw-r--r-- | layouts/partials/header/breadcrumbs.html | 3 | ||||
-rw-r--r-- | layouts/partials/header/header.html | 42 |
4 files changed, 46 insertions, 53 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d7d6af6..4c7116b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -60,34 +60,7 @@ {{ $section_class = "emacs" }} {{ end }} <body class="{{ $section_class }}"> - <header> - <div class="logo"> - {{ if in .Page.Params.categories "bsd" }} - {{ $logo := resources.Get "logos/logo-beastie-white.svg"}} - <img src="{{$logo.Permalink}}" class="beastie"> - {{ else if in .Page.Params.categories "star-trek" }} - {{ $logo := resources.Get "logos/logo-startrek-white.svg" }} - <img src="{{$logo.Permalink}}" class="stbadge"> - {{ else if in .Page.Params.categories "blog" }} - {{ $logo := resources.Get "logos/logo-blog-white.svg" }} - <img src="{{$logo.Permalink}}" class="blogicon"> - {{ else if in .Page.Params.categories "article" }} - {{ $logo := resources.Get "logos/logo-article-white.svg" }} - <img src="{{$logo.Permalink}}" class="files"> - {{ else if in .Page.Params.Categories "emacs" }} - {{ $logo := resources.Get "logos/logo-emacs-white.svg" }} - <img src="{{$logo.Permalink}}" class="emacslogo"> - {{ end }} - </div> - - <div class="name"> - <nav> - <h1>{{ .Page.Title }}</h1> - {{ partial "back_nav" . }} - </nav> - </div> - </header> - + {{ partial "header/header" . }} <main class="right-column"> diff --git a/layouts/partials/back_nav.html b/layouts/partials/back_nav.html deleted file mode 100644 index ceb0813..0000000 --- a/layouts/partials/back_nav.html +++ /dev/null @@ -1,25 +0,0 @@ -{{- if not .Page.Params.noback }} -<nav class="back-link"> -{{- if .Page.Params.hardback }} - <a href="/">← back to Homepage</a> -{{- else if in .Page.Params.Categories "star-trek" }} - <a href="/star-trek/">← back to Space Cadet Log</a> -{{- else if in .Page.Params.Category "site-info" }} - <a href="/site/">← Back to Site Info</a> -{{- else if in .Page.Params.Categories "site" }} - <a href="/site/">← Back to Site Info</a> -{{- else if in .Page.Params.Categories "bsd" }} - <a href="/bsd/">← Back to Daemonic BSD Site</a> -{{- else if in .Page.Params.Categories "blog" }} - <a href="/blog/">← Back to Michal's blog</a> -{{- else if in .Page.Params.Categories "article" }} - <a href="/articles/">← Back to Article Library</a> -{{- else if in .Page.Params.Categories "emacs" }} - <a href="/emacs/">← Back to C-X emacs</a> -{{- end }} -{{- if not .Page.Params.hardback }} - <br> - <a href="/">↞ back to Homepage</a> -{{- end }} -</nav> -{{- end }} diff --git a/layouts/partials/header/breadcrumbs.html b/layouts/partials/header/breadcrumbs.html new file mode 100644 index 0000000..c777c5b --- /dev/null +++ b/layouts/partials/header/breadcrumbs.html @@ -0,0 +1,3 @@ +<nav aria-label="breadcrumb" class="breadcrumb"> +</nav> + diff --git a/layouts/partials/header/header.html b/layouts/partials/header/header.html new file mode 100644 index 0000000..9ebe72e --- /dev/null +++ b/layouts/partials/header/header.html @@ -0,0 +1,42 @@ +<header> + <div class="logo"> + {{ if in .Page.Params.categories "bsd" }} + {{ $logo := resources.Get "logos/logo-beastie-white.svg"}} + <img src="{{$logo.Permalink}}" class="beastie" alt="FreeBSD"> + {{ else if in .Page.Params.categories "star-trek" }} + {{ $logo := resources.Get "logos/logo-startrek-white.svg" }} + <img src="{{$logo.Permalink}}" class="stbadge" alt="Star Trek"> + {{ else if in .Page.Params.categories "blog" }} + {{ $logo := resources.Get "logos/logo-blog-white.svg" }} + <img src="{{$logo.Permalink}}" class="blogicon" alt="Blog"> + {{ else if in .Page.Params.categories "article" }} + {{ $logo := resources.Get "logos/logo-article-white.svg" }} + <img src="{{$logo.Permalink}}" class="files" blog="Articles"> + {{ else if in .Page.Params.Categories "emacs" }} + {{ $logo := resources.Get "logos/logo-emacs-white.svg" }} + <img src="{{$logo.Permalink}}" class="emacslogo" alt="Emacs"> + {{ end }} + </div> + + <div class="name" aria-label="bradcrumb"> + <nav> + <ol> + {{- range .Ancestors.Reverse }} + {{- if .LinkTitle}} + <li> + <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> + </li> + {{- end }} + {{- end }} + </ol> + <h1> + <a aria-current="page" href="{{ .RelPermalink }}"> + {{ .Page.Title }} + </a> + </h1> + <ol> + + + </nav> + </div> +</header> |