mirror of
https://github.com/Aroy-Art/Rinkusu.git
synced 2024-12-27 07:44:23 +01:00
Added bradcrumb partial
This commit is contained in:
parent
8766815524
commit
52ce90a03e
1 changed files with 26 additions and 0 deletions
26
layouts/partials/bradcrumb.html
Normal file
26
layouts/partials/bradcrumb.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
{{"<!-- Bradcrumb Section -->" | safeHTML}}
|
||||
{{ $siteUrl := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||
{{ $.Scratch.Add "sitePath" .Site.BaseURL }}
|
||||
|
||||
{{ $.Scratch.Add "siteBreadcrumbs" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) }}
|
||||
{{ range $index, $element := split $siteUrl "/" }}
|
||||
{{ $.Scratch.Add "sitePath" $element }}
|
||||
{{ $.Scratch.Add "sitePath" "/" }}
|
||||
{{ if ne $element "" }}
|
||||
{{ $.Scratch.Add "siteBreadcrumbs" (slice (dict "url" ($.Scratch.Get "sitePath") "name" . "position" (add $index 2))) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav aria-label="breadcrumb">
|
||||
<!-- <p> You are hear ↓↓↓</p> -->
|
||||
<ol class="breadcrumb">
|
||||
{{ range $.Scratch.Get "siteBreadcrumbs" }}
|
||||
<li class="breadcrumb-item"><a href="{{ .url }}">{{ .name }}</a></li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</nav>
|
||||
{{"<!-- /Bradcrumb Section -->" | safeHTML}}
|
Loading…
Reference in a new issue