diff options
author | uPagge <upagge@mail.ru> | 2020-12-02 23:05:51 +0300 |
---|---|---|
committer | uPagge <upagge@mail.ru> | 2020-12-02 23:05:51 +0300 |
commit | cc1ec25adb7253b80930063ec9c6df889712b623 (patch) | |
tree | 6e29a16df58b508601db7b34a8baff34bd3b7ffc /layouts/partials | |
parent | 62560a9d35f60acdfaec8c92b5912b64226ce877 (diff) |
Вторая версия breadcrumbs
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/breadcrumbs.html | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 502ba8d..db808ce 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,10 +1,15 @@ <div id="breadcrumbs"> <a href="/">Home</a> / - {{- $categories := index ($.Params.categories) 0 -}} - {{- $category := partialCached "function/path.html" $categories $categories | printf "/categories/%v" | $.Site.GetPage -}} - {{- $categories = (printf ` <a href="%v">%v</a> ` $category.RelPermalink $category.Title) -}} - {{- with $categories -}} + {{- $categories := slice -}} + {{- range $.Params.categories -}} + {{- $category := partialCached "function/path.html" . . | printf "/categories/%v" | $.Site.GetPage -}} + {{- $categories = $categories | append (printf `<a href="%v"> %v</a> ` $category.RelPermalink $category.Title) -}} + {{- end -}} + {{- with delimit $categories " " -}} + {{ $first := index ($categories) 0 }} + {{- with $first -}} {{- dict "Categories" . | T "includedInCategories" | safeHTML -}} {{- end -}} + {{- end -}} / <a href="/"> {{ .Title }} </a> </div>
\ No newline at end of file |