aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/index/announcements.html
diff options
context:
space:
mode:
authorMantas Vilčinskas <hi@mnts.lt>2021-10-02 21:38:12 +0300
committerGitHub <noreply@github.com>2021-10-02 21:38:12 +0300
commit56f6b868a508ed6ce37afbbe46449ea7b6044ad1 (patch)
tree57c47d5491f495b5301190c1f876c9da043698bb /layouts/partials/index/announcements.html
parentc2a1e851bfa14012915a6bb3f85e3631c7c66d0f (diff)
#205 - add pinned informational posts
Diffstat (limited to 'layouts/partials/index/announcements.html')
-rw-r--r--layouts/partials/index/announcements.html27
1 files changed, 24 insertions, 3 deletions
diff --git a/layouts/partials/index/announcements.html b/layouts/partials/index/announcements.html
index 25a1719..01b353d 100644
--- a/layouts/partials/index/announcements.html
+++ b/layouts/partials/index/announcements.html
@@ -1,7 +1,8 @@
{{ $incidents := where .Site.RegularPages "Params.section" "issue" }}
{{ $active := where $incidents "Params.resolved" "=" false }}
+{{ $pinned := where $incidents "Params.pin" "=" true }}
-{{ if $active }}
+{{ if or ($active) ($pinned) }}
<div class="announcement-box" style="border-bottom: 0">
{{ range $active }}
<div class="padding">
@@ -17,10 +18,30 @@
{{ end }}
</small></p>
- {{ .Content | safeHTML | truncate 500 "…" }}
+ {{ .Content | safeHTML | truncate 500 "…" }} <a href="{{ .RelPermalink }}"><b>→</b></a>
+ <p></p>
+ </div>
+ <hr class="clean announcement-box">
+ {{ end }}
+
+ {{ range $pinned }}
+ <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 }}
</div>
-{{ end }} \ No newline at end of file
+{{ end }}