From 28689bcf5845de0ec8379e38a654a4f4da8521ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 6 Nov 2022 19:48:41 +0000 Subject: [PATCH] added new fixed header --- assets/css/compiled/main.css | 36 ++++++ config/_default/params.toml | 3 + exampleSite/config/_default/params.toml | 3 + layouts/_default/single.html | 2 +- layouts/partials/header/basic.html | 27 ----- layouts/partials/header/fixed.html | 145 ++++++++++++++++++++++++ 6 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 layouts/partials/header/fixed.html diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index ac324d2c..9ee665ad 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1599,6 +1599,14 @@ select { margin-right: -0.5rem; } +.ml-auto { + margin-left: auto; +} + +.mr-auto { + margin-right: auto; +} + .mb-0 { margin-bottom: 0px; } @@ -1651,6 +1659,14 @@ select { height: 2rem; } +.h-\[120px\] { + height: 120px; +} + +.h-\[100px\] { + height: 100px; +} + .h-\[250px\] { height: 250px; } @@ -1683,6 +1699,10 @@ select { min-height: 0px; } +.min-h-\[148px\] { + min-height: 148px; +} + .w-12 { width: 3rem; } @@ -1755,6 +1775,10 @@ select { max-width: 5rem; } +.max-w-\[64rem\] { + max-width: 64rem; +} + .max-w-xl { max-width: 36rem; } @@ -2154,6 +2178,14 @@ select { padding-bottom: 1rem; } +.pl-\[24px\] { + padding-left: 24px; +} + +.pr-\[24px\] { + padding-right: 24px; +} + .pt-16 { padding-top: 4rem; } @@ -3723,6 +3755,10 @@ body:has(#menu-controller:checked) { top: 2.5rem; } + .lg\:top-\[140px\] { + top: 140px; + } + .lg\:left-0 { left: 0px; } diff --git a/config/_default/params.toml b/config/_default/params.toml index 134ee221..0134cc8e 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -15,6 +15,9 @@ enableCodeCopy = true # mainSections = ["section1", "section2"] # robots = "" +[header] + layout = "basic" # valid options: basic, fixed + [footer] # showMenu = true showCopyright = true diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index ce3c7070..32446b87 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -15,6 +15,9 @@ enableCodeCopy = true mainSections = ["docs"] # robots = "" +[header] + layout = "fixed" # valid options: basic, fixed + [footer] showMenu = true showCopyright = true diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 44569ba7..adf1d7a3 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -24,7 +24,7 @@ {{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in .TableOfContents " -
+
{{ partial "toc.html" . }}
diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html index cdbfebd8..be4f6106 100644 --- a/layouts/partials/header/basic.html +++ b/layouts/partials/header/basic.html @@ -121,31 +121,4 @@ - - - - \ No newline at end of file diff --git a/layouts/partials/header/fixed.html b/layouts/partials/header/fixed.html new file mode 100644 index 00000000..ab32a2eb --- /dev/null +++ b/layouts/partials/header/fixed.html @@ -0,0 +1,145 @@ +
+
+ +
+
+ {{ if .Site.Params.Logo -}} + {{ $logo := resources.Get .Site.Params.Logo }} + {{ if $logo }} + + {{ end }} + {{- end }} +
+ + +
+ + + + {{ partial "translations.html" . }} + + {{ if .Site.Params.enableSearch | default false }} + + {{ end }} + + {{/* Appearance switch */}} + {{ if .Site.Params.footer.showAppearanceSwitcher | default false }} + + {{ end }} + +
+
+
+ + +
+
+
+
+ \ No newline at end of file