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 6666 {{ else }}
6767 < main class ="content col d-block align-top content-no-toc " role ="main ">
6868 {{ end }}
69-
69+
7070 < section class ="main-layout ">
7171 < div class ="sidebar-layout " id ="sidebar-layout ">
7272 < button class ="sidebar__mobile__toggle " aria-expanded ="false " data-mf ="true "> {{ partial "lucide" (dict "context" . "icon" "x")}}Close</ button >
8484 {{ end }}
8585 {{ end }}
8686 </ section >
87+ {{ partial "banner" .}}
8788 < h1 > {{ .Title }}</ h1 >
8889 {{ $content | safeHTML }}
8990 {{ if eq .Page.Draft true }}{{ partial "draft-badge.html" . }}{{ end }}
Original file line number Diff line number Diff line change 3131 < h1 > {{ .Title }}</ h1 >
3232 {{ .Content }}
3333
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" .}}
4235
4336 {{ if (lt .WordCount 1) }}
4437 {{ 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">
1818 </ div >
1919 </ div >
2020
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" .}}
2922
3023 {{ if or (lt .WordCount 1) (eq $PageTitle "F5 NGINX One Console") (eq $PageTitle "F5 NGINX App Protect DoS") (eq $PageTitle "F5 NGINX Plus") }}
3124 < section >
You can’t perform that action at this time.
0 commit comments