Skip to content

Commit 42fc484

Browse files
authored
Merge pull request #3310 from ricekot/fix-alertset-layout
Fix alertset layout
2 parents 0f9e1eb + 1cf496a commit 42fc484

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

site/layouts/alertset/single.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,23 @@ <h1 class="text--white">{{ .Title }}</h1>
4646
</section>
4747
<section class="col-2-3">
4848
<h3 class="mb-10">Alerts</h3>
49+
{{- $alertSlice := slice -}}
50+
{{- range $alertRef, $alert := .Params.alerts -}}
51+
{{- $parts := split $alertRef "-" -}}
52+
{{- $alertRefQualifier := index $parts 1 | int -}}
53+
{{- $alertSlice = $alertSlice | append (dict "qualifier" $alertRefQualifier "alert" $alert) -}}
54+
{{- end -}}
55+
{{ $sortedAlerts := sort $alertSlice "qualifier" }}
4956
<ul data-attr="alerts">
50-
{{ range .Params.alerts }}
57+
{{ range $sortedAlerts }}
5158
<li>
52-
<a href="/docs/alerts/{{ .alertid }}">{{ .alertid }}</a> {{ .name }}
59+
<a href="/docs/alerts/{{ .alert.alertid }}">{{ .alert.alertid }}</a> {{ .alert.name }}
5360
</li>
5461
{{ end }}
5562
</ul>
5663
<h4 class="mb-10">Code</h4>
5764
<a href='{{ .Params.code }}'>
58-
{{ index (split .Params.code "main/java/") 1 }}
65+
{{ .Params.linktext }}
5966
</a>
6067
</section>
6168
</main>

0 commit comments

Comments
 (0)