hugo-theme-mofo

Minimal theme for Hugo
git clone https://git.bracken.jp/hugo-theme-mofo.git
Log | Files | Refs | LICENSE

commit c8f2af9282637099acca473a1725bd159f305dd3
parent e75c20136d7d9e5de8aeac9a2088b16104931992
Author: Chris Bracken <chris@bracken.jp>
Date:   Mon, 21 Nov 2022 11:23:03 -0800

Add optional rel attribute to menu links

If menu.main.params.rel is specified, add a rel attribute to the main
menu links.

Diffstat:
Mlayouts/partials/header.html | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -6,7 +6,7 @@ <nav class="site-navbar"> <ul id="menu" class="menu"> {{- range .Site.Menus.main }} - <li class="menu-item"><a class="menu-item-a" href="{{ .URL | safeURL }}">{{ .Name }}</a></li> + <li class="menu-item"><a class="menu-item-a" {{ if .Params.rel }}rel="{{ .Params.rel }}"{{ end }}href="{{ .URL | safeURL }}">{{ .Name }}</a></li> {{- end }} </ul> </nav>