Skip to content
This repository has been archived by the owner on Dec 20, 2021. It is now read-only.

Commit

Permalink
Первая версия breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
uPagge committed Dec 2, 2020
1 parent 577d3c0 commit 62560a9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions layouts/partials/breadcrumbs.html
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit 62560a9

Please sign in to comment.