github.com/choria-io/go-choria@v0.28.1-0.20240416190746-b3bf9c7d5a45/docs/themes/hugo-theme-relearn/layouts/partials/shortcodes/notice.html (about)

     1  {{- $page := .page }}
     2  {{- if and (not $page) .context }}
     3    {{- $page = .context }}
     4    {{- warnf "%q: DEPRECATED parameter 'context' for shortcode 'notice' found, use 'page' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/migration#5180" $page.File.Filename }}
     5  {{- end }}
     6  {{- $color := .color | default "" }}
     7  {{- $content := .content }}
     8  {{- $style := .style | default "default" }}
     9  {{- $title := .title }}
    10  {{- if not $title }}
    11    {{- if eq $style "info" }}{{ $title = $style | T }}{{ end }}
    12    {{- if eq $style "warning" }}{{ $title = $style | T }}{{ end }}
    13    {{- if eq $style "note" }}{{ $title = $style | T }}{{ end }}
    14    {{- if eq $style "tip" }}{{ $title = $style | T }}{{ end }}
    15  {{- end }}
    16  {{- $title = trim $title " " }}
    17  {{- $icon := .icon | default "" }}
    18  {{- if and (not $icon) (eq (len $icon) 0) }}
    19    {{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }}
    20    {{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }}
    21    {{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }}
    22    {{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }}
    23  {{- end }}
    24  {{- $icon = trim $icon " " }}
    25  {{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }}
    26    {{- $icon = printf "fa-fw fas fa-%s" $icon }}
    27  {{- end }}
    28  {{- with $page }}
    29  <div class="box notices cstyle {{ $style }}"{{ if $color }} style="--VARIABLE-BOX-color: {{ $color }};"{{ end }}>
    30    <div class="box-label">{{ if $icon }}<i class="{{ $icon }}"></i>{{ end }}{{ if and $icon $title }} {{ end }}{{ $title | .RenderString }}</div>
    31    <div class="box-content">
    32  {{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}<p>{{ end }}<!-- we add a DOM element here if there is none to make collapsing marings work -->
    33  {{ $content | safeHTML }}</div><!-- no line break allowed here because of awkward behavior of Hugo 110 or this theme when tag shortcode is called standalone outside of tags shortcode ? -->
    34  </div>
    35  {{- end }}