From: XhmikosR Date: Mon, 15 Feb 2021 19:08:44 +0000 (+0200) Subject: Simplify bugify.html (#33063) X-Git-Tag: v4.6.1~84 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29674b8426a564a13f2edc691e442ed8cc48069b;p=thirdparty%2Fbootstrap.git Simplify bugify.html (#33063) * use `in` instead of `strings.Contains` since the latter is not documented * use `cond` --- diff --git a/site/layouts/partials/bugify.html b/site/layouts/partials/bugify.html index 7edacb5d61..845cdf7a33 100644 --- a/site/layouts/partials/bugify.html +++ b/site/layouts/partials/bugify.html @@ -1,12 +1,8 @@ -{{- $words := (split . " ") -}} +{{- $words := split . " " -}} {{- range $word := $words -}} - {{- if (strings.Contains $word "#") -}} - {{- $separator := false -}} - - {{- if (strings.Contains $word ",") -}} - {{- $separator = true -}} - {{- end -}} + {{- if (in $word "#") -}} + {{- $has_separator := cond (in $word ",") true false -}} {{- $data := split $word "#" -}} {{- $bug_cat := replace (index $data 0) "\n" "" -}} @@ -32,7 +28,7 @@ {{- else if (eq $bug_cat "Normalize") -}} Normalize #{{ $bug_id }} {{- end -}} - {{- if (eq $separator true) }}, {{ end -}} + {{- if $has_separator }}, {{ end -}} {{- else -}} {{- $word -}}