aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index/announcements.html
blob: e33c26225ca624a544d9a91b818c1fc65a8bd3a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}
{{ $active := where $incidents "Params.resolved" "=" false }}
{{ $activeIncidents := where $incidents "Params.informational" "=" false }}
{{ $pinned := where $incidents "Params.pin" "=" true }}

{{ if or ($activeIncidents) ($pinned) }}
  <div class="announcement-box" style="border-bottom: 0">
    {{ range $activeIncidents }}
      <div class="padding">
        <p>
          <a href="{{ .RelPermalink }}"><strong class="bold">{{ .Title }} →</strong></a>
        </p>

        <p><small>
          {{ range .Params.Affected }}
              
          <a href="{{ printf "/affected/%s/" (. | urlize) | relURL }}" class="tag no-underline">{{ . }}</a>
          
          {{ end }}
        </small></p>

        {{ .Content | safeHTML | truncate 500 "…" }} <a href="{{ .RelPermalink }}"><b>→</b></a>
        <p></p>
      </div>
      <hr class="clean announcement-box">
    {{ end }}
    
    {{ range $pinned }}
      {{ if .Params.informational }}
      <div class="padding">
        <p>
          <a href="{{ .RelPermalink }}"><strong class="bold">{{ .Title }} →</strong></a>
        </p>

        <p><small>
          {{ range .Params.Affected }}
              
          <a href="{{ printf "/affected/%s/" (. | urlize) | relURL }}" class="tag no-underline">{{ . }}</a>
          
          {{ end }}
        </small></p>

        {{ .Content | safeHTML | truncate 500 "…" }}
        <p></p>
      </div>
      <hr class="clean announcement-box">
      {{ end }}
    {{ end }}
  </div>
{{ end }}