diff --git a/i18n/en.yaml b/i18n/en.yaml index 6e48dbae..e88f524b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -6,6 +6,12 @@ - id: table_of_contents translation: Table of Contents +- id: on_this_page + translation: On this page + +- id: back_to_top + translation: Back to top + # General - id: related diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index 2cc3cc70..55caa522 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -1434,11 +1434,6 @@ table > tbody > tr:hover > th { * Alerts **************************************************/ -div.alert { - border-radius: 10px; - margin-bottom: 1rem; -} - div.alert p { position: relative; display: block; @@ -1453,7 +1448,7 @@ div.alert p:first-child::before { top: -0.5rem; left: -2rem; font-size: 1.5rem; - color: #fff; + color: #209cee; font-family: 'Font Awesome 5 Free'; font-weight: 900; content: '\f05a'; @@ -1464,34 +1459,28 @@ div.alert p:first-child::before { div.alert-warning p:first-child::before { font-family: 'Font Awesome 5 Free'; font-weight: 900; + color: #ff3860; content: '\f071'; } div.alert a { - color: rgba(255,255,255,0.9); + color: currentColor; text-decoration: none; - border-bottom: solid 1px #e4e4e4; - transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out; -} - -div.alert a:hover { - border-bottom-color: transparent; - color: rgba(255,255,255,0.5) !important; + border-bottom: solid 1px currentColor; } .alert-note { - color: #fff; - background-color: #03A9F4; /* Material LightBlue500 */ - border-color: #bce8f1; + color: #12537e; + background-color: #f6fbfe; + border-color: #209cee; } .alert-warning { - color: #fff; - background-color: #f44336; /* Material Red500 */ - border-color: #ebccd1; + color: #cd0930; + background-color: #fff5f7; + border-color: #ff3860; } - /************************************************* * Documentation layout **************************************************/ @@ -1673,13 +1662,22 @@ div.alert a:hover { /* Docs TOC nav. */ +.docs-toc-title { + color: #b5b5b5; + font-size: .875rem; + font-weight: 600; + padding-left: calc(1.5rem + 1px); + margin-bottom: .5rem; +} + #TableOfContents { padding-left: 0; border-left: 1px solid #eee; } -#TableOfContents ul { - padding-left: 1rem; +#TableOfContents ul, +ul.toc-top { + padding-left: 0; } #TableOfContents ul ul { @@ -1690,13 +1688,16 @@ div.alert a:hover { display: block; } -#TableOfContents li a { +#TableOfContents li a, +.toc-top li a { display: block; padding: .125rem 1.5rem; color: #99979c; + font-size: 0.7rem; } -#TableOfContents li a:hover { +#TableOfContents li a:hover, +.toc-top li a:hover { color: {{ .Get "primary" }}; text-decoration: none; } diff --git a/layouts/partials/docs_layout.html b/layouts/partials/docs_layout.html index 9fff5a7d..da7ff3c4 100644 --- a/layouts/partials/docs_layout.html +++ b/layouts/partials/docs_layout.html @@ -10,7 +10,17 @@ {{ if .Params.toc }}
+ {{ with (i18n "on_this_page") }} +

{{.}}

+ {{ end }} + {{ .TableOfContents }} + + + + {{ partial "docs_toc_foot.html" . }}
{{ end }} diff --git a/layouts/partials/docs_toc_foot.html b/layouts/partials/docs_toc_foot.html new file mode 100644 index 00000000..e69de29b diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 80df0363..9712a2ec 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -142,4 +142,4 @@ {{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }} - + diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 66c4cfa1..9391d997 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -28,7 +28,7 @@ @@ -58,21 +58,40 @@ {{ end }} {{ end }} - {{ if and .IsTranslated (not $align_right) }} - - {{ end }} - {{ if .IsTranslated }} - {{ if not $align_right }} + {{ if and (not $align_right) (or .IsTranslated .Site.Menus.main_right) }} +