diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-31 16:46:33 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2023-07-31 16:46:33 +0700 |
commit | e19108bbf10b876fbf55ee82f19dd0dda4f9324c (patch) | |
tree | 131f4b5087aa6ae5303b18cd82c0a70add1e23d0 | |
parent | 5c9e0ecbb5e5d8c777bef62a0074c91b4ff80553 (diff) | |
download | victor-e19108bbf10b876fbf55ee82f19dd0dda4f9324c.tar.gz |
Use range+where instead of range+if
-rw-r--r-- | layouts/partials/breadcrumbs.html | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 3dc235b..04c4ac3 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,12 +1,10 @@ <nav aria-label="breadcrumb" class="breadcrumb"> <ol> - {{ range .Ancestors.Reverse }} - {{ if in .Params.categories "book" }} + {{ range where .Ancestors.Reverse "Params.categories" "intersect" (slice "book") }} <li> <a href="{{ .Permalink }}">{{ .LinkTitle }}</a> </li> {{ end }} - {{ end }} <li class="active"> <a aria-current="page">{{ .LinkTitle }}</a> </li> |