diff options
author | Matt Stratton <matt.stratton@gmail.com> | 2021-03-01 19:54:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 19:54:19 +0300 |
commit | 7dcdcce5258d1db2fe58c6885727034853f958ca (patch) | |
tree | 2cb49636051dff72a67af9e8b7e15ccc4114c76e | |
parent | 40522d6e43cefc1f50eb16263fb6fe1e7a5aa4ac (diff) |
Add absURL to menus (#343)
Signed-off-by: Matt Stratton <matt.stratton@hey.com>
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/partials/header.html | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 8e5c11c..edaf954 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -66,6 +66,10 @@ buildFuture = true identifier = "podcasts" url = "/books" parent = "resources" +[[Menu.Main]] + name = "Internet" + identifier = "internet" + url = "https://www.google.com" [params] mainSections = ["episode"] diff --git a/layouts/partials/header.html b/layouts/partials/header.html index c81174a..5a2f35c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -14,13 +14,13 @@ <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{{ .Name }}</a> <div class="dropdown-menu"> {{ range sort .Children "Identifier"}} - <a class="dropdown-item{{ if $currentPage.IsMenuCurrent "Main" . }} active {{ end }}" href="{{ .URL }}">{{ .Name }}</a> + <a class="dropdown-item{{ if $currentPage.IsMenuCurrent "Main" . }} active {{ end }}" href="{{ .URL | absURL}}">{{ .Name }}</a> {{ end }} </div> </li> {{ else }} <li class= "nav-item {{ if or ($currentPage.IsMenuCurrent "Main" .) ($currentPage.HasMenuCurrent "Main" .) }} active {{ end }}"> - <a href="{{ .URL }}" class="nav-link"> + <a href="{{ .URL | absURL }}" class="nav-link"> {{ .Pre }} <span>{{ .Name }}</span> </a> |