Revise page header styles

- more compact headers when announcements are showing
- when no announcement showing, top level docs sections
  (eg Concepts, Tasks, Reference) have a heading in the top nav
- when announcement is showing, rely on the breadcrumb trail plus
  page introduction text for each top level section
- switch from plain black docs header to match other sections
This commit is contained in:
Tim Bannister
2021-10-13 22:47:29 +01:00
parent 85d3fb9900
commit 1e436f4587
14 changed files with 182 additions and 149 deletions
+5 -5
View File
@@ -15,18 +15,18 @@
{{- if or (eq .endTime nil ) (gt ( time .endTime ) now ) -}}
{{- if not $announcementShown -}}
{{- $announcementShown = true -}}
<section lang="en" id="announcement" style="background-color: #3371e3; color: #fff; {{ .style | safeCSS }}">
<div lang="en" id="announcement" style="background-color: #3371e3; color: #fff; {{ .style | safeCSS }}">
<aside>
<div class="content announcement main-section" data-nosnippet>
<div class="announcement-main" data-nosnippet>
{{ if .title }}
<h4 class="announcement">
<h4>
{{ .title | markdownify }}
</h4>
{{ end }}
<p class="announcement">{{ .message | markdownify }}</p>
<p>{{ .message | markdownify }}</p>
</div>
</aside>
</section>
</div>
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1 @@
{{ .page.Content }}
@@ -1,34 +0,0 @@
{{ $dateRegExp := "^[0-9]{4}-1[0-2]|0[1-9]-(?:3[01]|0[1-9]|[12][0-9])T(?:2[0-3]|[01][0-9]):(?:[0-5][0-9]):(?:60|[0-5][0-9])$" }}
{{ $announcementShown := false }}
{{ range $.Site.Data.announcements }}
{{ range .announcements }}
{{ if or ( eq .endTime nil ) ( eq .message nil ) }}
{{ errorf "Invalid announcement: %#v" . }}
{{ end }}
{{ if and (ne .startTime nil ) (lt ( len ( findRE $dateRegExp .startTime ) ) 1 ) }}
{{ errorf "Invalid announcement start time: %#v" .startTime }}
{{ end }}
{{ if lt ( len ( findRE $dateRegExp .endTime ) ) 1 }}
{{ errorf "Invalid announcement end time: %#v" .endTime }}
{{ end }}
{{ if or (eq .startTime nil ) (lt ( time .startTime ) now ) }}
{{- if or (eq .endTime nil ) (gt ( time .endTime ) now ) -}}
{{- if not $announcementShown -}}
{{- $announcementShown = true -}}
<section lang="en" id="fp-announcement" style="background-color: #3371e3; color: #fff; {{ .style | safeCSS }}">
<aside>
<div class="content announcement main-section" data-nosnippet>
{{ if .title }}
<h4 class="announcement">
{{ .title | markdownify }}
</h4>
{{ end }}
<p class="announcement">{{ .message | markdownify }}</p>
</div>
</aside>
</section>
{{- end -}}
{{- end -}}
{{- end -}}
{{ end }}
{{ end }}
+1 -1
View File
@@ -1,5 +1,5 @@
{{ $cover := .HasShortcode "blocks/cover" }}
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }} flex-row td-navbar" data-auto-burger="primary">
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }} flex-column flex-md-row td-navbar" data-auto-burger="primary">
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}"></a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">