diff --git a/README.md b/README.md index 1f12375..54bc90d 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,37 @@ Optional params: `title`, `height` (a CSS length such as `60vh`, which crops the image with `object-fit: cover`) and `class`. +## Navigation + +The navbar renders the `main` menu. A top-level entry that has child +entries (other entries pointing at it with `parent:`) is rendered as a +Bootstrap dropdown; entries without children stay as plain links. Only +one level of nesting is supported (Bootstrap 5 has no nested submenus). + +```yaml +# hugo.yaml / menus.yaml +menu: + main: + - name: Home + pageRef: / + weight: 1 + - name: Research + weight: 2 + - name: Proposals + parent: Research + pageRef: /proposals + weight: 1 + - name: History + parent: Research + pageRef: /history + weight: 2 +``` + +The entry matching the current page (and its parent, for a dropdown +child) gets Bootstrap's `active` class. A parent entry acts only as the +dropdown toggle, so it does not need its own `url`/`pageRef`. + + ## Custom error page The theme has a custom 404 error page. diff --git a/layouts/_partials/header.html b/layouts/_partials/header.html index 72e6b0f..255be65 100644 --- a/layouts/_partials/header.html +++ b/layouts/_partials/header.html @@ -5,44 +5,49 @@ {{- if os.FileExists "static/img/logo.svg" -}}{{- $logo = "img/logo.svg" -}}{{- end -}} {{ .Site.Title }} - - - +