diff options
author | uPagge <upagge@mail.ru> | 2020-12-02 22:45:30 +0300 |
---|---|---|
committer | uPagge <upagge@mail.ru> | 2020-12-02 22:45:30 +0300 |
commit | 62560a9d35f60acdfaec8c92b5912b64226ce877 (patch) | |
tree | fabfd7f999b9ede7329a82f52bdcff7774076c30 /layouts/partials | |
parent | 577d3c0e73e9bded4c7d0cc17ccec45694f43546 (diff) |
Первая версия breadcrumbs
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/breadcrumbs.html | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 1c806d1..502ba8d 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,8 +1,10 @@ <div id="breadcrumbs"> - <a href="/">Home</a> - {{ range (split .RelPermalink "/") }} - {{ if gt (len . ) 0 }} - / <a href="/{{ . }}">{{ humanize (replace . "posts" "blog") }}</a> - {{ end }} - {{ end }} + <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 -}} + {{- dict "Categories" . | T "includedInCategories" | safeHTML -}} + {{- end -}} + / <a href="/"> {{ .Title }} </a> </div>
\ No newline at end of file |