update breadcrumb, lang-switcher

This commit is contained in:
somrat sorkar
2023-06-04 11:07:38 +06:00
parent 0dec449704
commit fb0fa2d9ef
6 changed files with 41 additions and 28 deletions

View File

@@ -3,27 +3,7 @@
<div
class="from-body to-theme-light dark:from-darkmode-body dark:to-darkmode-theme-light rounded-2xl bg-gradient-to-b px-8 py-14">
<h1>{{ .Title | title }}</h1>
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ul class="breadcrumb mt-6 inline-flex">
<li class="mx-1 capitalize">
<a class="text-primary dark:text-darkmode-primary" href="/">Home</a>
</li>
{{ range $index, $element := split $url "/" }}
{{ $.Scratch.Add "path" $element }}
{{ if ne $element "" }}
<li class="text-light dark:text-darkmode-light mx-1 capitalize">
<span class="inlin-block mr-1">/</span>
<a
class="text-primary dark:text-darkmode-primary"
href="{{ $.Scratch.Get `path` }}"
>{{ . }}</a
>
</li>
{{ $.Scratch.Add "path" "/" }}
{{ end }}
{{ end }}
</ul>
{{ partial "components/breadcrumb" . }}
</div>
</div>
</section>