update breadcrumb

This commit is contained in:
somrat sorkar 2023-06-04 13:29:21 +06:00
parent 4523fa4fc9
commit 76ed462707
3 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,6 @@
- id: home
translation: Home
- id: read_more
translation: Read More
@ -23,7 +26,7 @@
translation: Back To Home
- id: search_input_placeholder
translation: Search Post ..
translation: Search Post ...
- id: no_results_for
translation: No results for

View File

@ -1,9 +1,18 @@
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $lang := .Lang | urlize }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ul class="breadcrumb mt-6 inline-flex">
{{ $context := .Context }}
{{ $class := .Class }}
{{ $base := site.BaseURL }}
{{ $url := replace $context.Permalink ( printf "%s" $base) "" }}
{{ $lang := $context.Lang }}
{{ $.Scratch.Add "path" $base }}
<ul class="{{ $class }} inline-flex">
<li class="mx-1 capitalize">
<a class="text-primary dark:text-darkmode-primary" href="/">Home</a>
<a
class="text-primary dark:text-darkmode-primary"
href="{{ $base | relLangURL }}">
{{ i18n "home" | default "Home" }}
</a>
</li>
{{ range $index, $element := split $url "/" }}
{{ if ne $element $lang }}

View File

@ -3,7 +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>
{{ partial "components/breadcrumb" . }}
{{ partial "components/breadcrumb" (dict "Context" . "Class" "mt-6") }}
</div>
</div>
</section>