update breadcrumb
This commit is contained in:
parent
dd7c13e06b
commit
50f2f0444f
@ -1,5 +1,5 @@
|
||||
######################## default configuration ####################
|
||||
baseURL = "https://hugoplate.netlify.app/"
|
||||
baseURL = "https://hugoplate.netlify.app/site/"
|
||||
title = "Hugoplate"
|
||||
theme = "hugoplate"
|
||||
# Default time zone for time stamps; use any valid tz database name: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
||||
|
@ -1,41 +1,31 @@
|
||||
{{ $context := .Context }}
|
||||
{{ $class := .Class }}
|
||||
{{ $base := site.BaseURL }}
|
||||
{{ $pageLink := replace $context.Permalink $base "" }}
|
||||
{{ $lang := $context.Lang }}
|
||||
{{ $context.Scratch.Set "path" "/" }}
|
||||
|
||||
|
||||
<ul class="{{ $class }} inline-flex">
|
||||
<li class="mx-1 capitalize">
|
||||
<ul class="{{ $class }} inline-flex space-x-1 capitalize">
|
||||
<li>
|
||||
<a
|
||||
class="text-primary dark:text-darkmode-primary"
|
||||
href="{{ $base | relLangURL }}">
|
||||
{{ i18n "home" | default "Home" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ range $index, $element := split $pageLink "/" }}
|
||||
{{ if ne $element $lang }}
|
||||
{{ $context.Scratch.Add "path" $element }}
|
||||
{{ else }}
|
||||
{{ $context.Scratch.Add "path" (add $element "/") }}
|
||||
{{ range $i, $e:= $context.Ancestors.Reverse }}
|
||||
<li>
|
||||
{{ if ne $i 0 }}
|
||||
{{ end }}
|
||||
{{ if and (ne $element "") (ne $element $lang) }}
|
||||
<li class="text-light dark:text-darkmode-light mx-1 capitalize">
|
||||
<span class="inlin-block mr-1">/</span>
|
||||
{{ if eq $element (path.BaseName $pageLink) }}
|
||||
<span class="text-primary dark:text-darkmode-primary">
|
||||
{{ . }}
|
||||
</span>
|
||||
{{ else }}
|
||||
<a
|
||||
class="text-primary dark:text-darkmode-primary"
|
||||
href="{{ $context.Scratch.Get `path` }}/">
|
||||
{{ . }}
|
||||
href="{{ .RelPermalink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
{{ end }}
|
||||
<span class="inlin-block mr-1">/</span>
|
||||
</li>
|
||||
{{ $context.Scratch.Add "path" "/" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<li>
|
||||
<span class="text-primary dark:text-darkmode-primary">
|
||||
{{ $context.Title }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "hugoplate",
|
||||
"description": "hugo tailwindcss boilerplate",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"license": "MIT",
|
||||
"author": "zeon.studio",
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user