diff --git a/assets/css/extended/header.css b/assets/css/extended/header.css index c0a186e13..1d8080777 100644 --- a/assets/css/extended/header.css +++ b/assets/css/extended/header.css @@ -15,15 +15,10 @@ header.header .logo a { header.header .nav { flex-wrap: unset; - line-height: 1; + line-height: 1.4; text-align: center; } -header.header #menu { - margin-left: 0; - overflow-x: unset; -} - header.header button#theme-toggle { font-size: 22px; margin: auto 12px; diff --git a/assets/css/extended/menu.css b/assets/css/extended/menu.css new file mode 100644 index 000000000..85ff8257d --- /dev/null +++ b/assets/css/extended/menu.css @@ -0,0 +1,66 @@ +/* + Hamburger menu, adapted from + https://github.com/jesse-wei/jessewei.dev-PaperMod/commit/9d74c542e64699557cda562edacacccc700cd3c8 + */ + +#menu-trigger { + display: none; +} + +.menu { + display: flex; + margin: auto var(--gap); + list-style: none; + word-break: keep-all; + overflow-x: auto; + white-space: nowrap; +} + +.menu li+li { + margin-inline-start: var(--gap); +} + +.menu a { + font-size: 16px; +} + +.menu .active { + font-weight: 500; + border-bottom: 2px solid currentColor; +} + +@media screen and (max-width: 768px) { + .menu { + list-style: none; + position: absolute; + right: 0; + z-index: 5; + padding: var(--gap); + background: var(--code-bg); + border-radius: var(--radius); + border: 2px solid var(--tertiary); + line-height: 2.5; + margin: calc(var(--header-height) - var(--gap)) var(--gap); + display: block; + } + + .list .menu { + background: var(--entry); + } + + .menu li+li { + margin-inline-start: 0; + } + + #menu-trigger { + font-size: 30px; + position: relative; + display: block; + float: right; + margin: auto var(--gap); + } + + .menu.hidden { + display: none; + } +} diff --git a/config.yml b/config.yml index 0b63c0ed3..2d25c643d 100644 --- a/config.yml +++ b/config.yml @@ -16,12 +16,15 @@ menu: - name: About url: /about/ weight: 1 + - name: Posts + url: /posts/ + weight: 2 - name: Talks url: /talks/ - weight: 2 - - name: Consult - url: /consult/ weight: 3 + - name: Consulting + url: /consult/ + weight: 4 params: analytics: diff --git a/layouts/partials/extend_footer.html b/layouts/partials/extend_footer.html index d4825c358..a8a48068b 100644 --- a/layouts/partials/extend_footer.html +++ b/layouts/partials/extend_footer.html @@ -1,10 +1,10 @@
@@ -27,3 +27,17 @@
+ + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index c02be7f45..fcb8ddfb2 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -120,7 +120,14 @@ {{- $currentPage := . }} -