Skip to content

Commit 98eb6e7

Browse files
committed
perf: cache partials
1 parent 67ed9a3 commit 98eb6e7

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<li class="breadcrumb-item">
2+
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
3+
{{- with .Params.nav_icon }}
4+
{{- partial "icons/icon" (merge . (dict "color" "" "className" "me-1")) }}
5+
{{- end }}
6+
{{- cond .IsHome (i18n "hb_breadcrumb_home") .Title -}}
7+
</a>
8+
</li>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{- range .Reverse }}
2+
{{ partialCached "hb/modules/breadcrumb/ancestor" . . }}
3+
{{- end -}}

layouts/partials/hb/modules/breadcrumb/index.html

+1-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@
22
<div class="container-fluid px-0 mb-4">
33
<nav aria-label="breadcrumb">
44
<ol class="hb-breadcrumb breadcrumb">
5-
{{- range .Ancestors.Reverse }}
6-
<li class="breadcrumb-item">
7-
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
8-
{{- with .Params.nav_icon }}
9-
{{- partial "icons/icon" (merge . (dict "color" "" "className" "me-1")) }}
10-
{{- end }}
11-
{{- cond .IsHome (i18n "hb_breadcrumb_home") .Title -}}
12-
</a>
13-
</li>
14-
{{- end -}}
5+
{{- partialCached "hb/modules/breadcrumb/ancestors" .Ancestors .Ancestors }}
156
<li class="breadcrumb-item active" aria-current="page">
167
<a href="{{ .RelPermalink }}" title="{{ .Title }}">
178
{{- with .Params.nav_icon }}

0 commit comments

Comments
 (0)