diff --git a/assets/css/common/header.css b/assets/css/common/header.css index 64894da4..bdbc4e36 100644 --- a/assets/css/common/header.css +++ b/assets/css/common/header.css @@ -1,3 +1,16 @@ +/* See: https://github.com/adityatelange/hugo-PaperMod/pull/979#issuecomment-1654974106 */ +html.header-sticky { + scroll-padding-top: calc(var(--header-height) * 2); +} + +header.header-sticky { + position: sticky; + top: 0; + width: 100%; + background: var(--theme); + z-index: 1000; +} + .nav { display: flex; flex-wrap: wrap; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 94e7d585..2ea6dc84 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,7 +3,7 @@ {{- end -}} - + {{- partial "head.html" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 82d025b6..d47233b3 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -39,7 +39,7 @@ {{- end }} -
+