File tree Expand file tree Collapse file tree 4 files changed +26
-17
lines changed Expand file tree Collapse file tree 4 files changed +26
-17
lines changed Original file line number Diff line number Diff line change 66
66
{{ else }}
67
67
< main class ="content col d-block align-top content-no-toc " role ="main ">
68
68
{{ end }}
69
-
69
+
70
70
< section class ="main-layout ">
71
71
< div class ="sidebar-layout " id ="sidebar-layout ">
72
72
< button class ="sidebar__mobile__toggle " aria-expanded ="false " data-mf ="true "> {{ partial "lucide" (dict "context" . "icon" "x")}}Close</ button >
84
84
{{ end }}
85
85
{{ end }}
86
86
</ section >
87
+ {{ partial "banner" .}}
87
88
< h1 > {{ .Title }}</ h1 >
88
89
{{ $content | safeHTML }}
89
90
{{ if eq .Page.Draft true }}{{ partial "draft-badge.html" . }}{{ end }}
Original file line number Diff line number Diff line change 31
31
< h1 > {{ .Title }}</ h1 >
32
32
{{ .Content }}
33
33
34
- {{- with .Params.banner -}}
35
- {{- if .enabled -}}
36
- {{- $bannerPage := site.GetPage .md -}}
37
- < div class ="banner banner-{{ .type }} ">
38
- {{ $bannerPage.Content }}
39
- </ div >
40
- {{- end -}}
41
- {{- end -}}
34
+ {{ partial "banner" .}}
42
35
43
36
{{ if (lt .WordCount 1) }}
44
37
{{ range .Pages.ByWeight }}
Original file line number Diff line number Diff line change
1
+ {{- with .Params.banner -}}
2
+ {{- if .enabled -}}
3
+ <!-- Gather the dates and default to beginning or end of time if frontmatter is not provided -->
4
+ {{- $currentDate := now | dateFormat "2006-01-02" -}}
5
+ {{- $startDate := index . "start-date" | default "0001-01-01" -}}
6
+ {{- $endDate := index . "end-date" | default "9999-12-31" -}}
7
+
8
+ <!-- Checks that the current date is within bounds-->
9
+ {{- if and (ge $currentDate $startDate) (le $currentDate $endDate) -}}
10
+ {{- if isset . "md" -}}
11
+ <!-- Show markdown if "md" is provided -->
12
+ {{- $bannerPage := site.GetPage .md -}}
13
+ < div class ="banner banner-{{ .type }} ">
14
+ {{ $bannerPage.Content }}
15
+ </ div >
16
+ {{- else -}}
17
+ <!-- Show default banner if "md" is NOT provided -->
18
+
19
+ {{- end -}}
20
+ {{- end -}}
21
+ {{- end -}}
22
+ {{- end -}}
Original file line number Diff line number Diff line change @@ -18,14 +18,7 @@ <h1 class="bd-title">
18
18
</ div >
19
19
</ div >
20
20
21
- {{- with .Params.banner -}}
22
- {{- if .enabled -}}
23
- {{- $bannerPage := site.GetPage .md -}}
24
- < div class ="banner banner-{{ .type }} ">
25
- {{ $bannerPage.Content }}
26
- </ div >
27
- {{- end -}}
28
- {{- end -}}
21
+ {{ partial "banner" .}}
29
22
30
23
{{ if or (lt .WordCount 1) (eq $PageTitle "F5 NGINX One Console") (eq $PageTitle "F5 NGINX App Protect DoS") (eq $PageTitle "F5 NGINX Plus") }}
31
24
< section >
You can’t perform that action at this time.
0 commit comments