From 0ea18a0a8740be7e637c182856c33e393cfa385b Mon Sep 17 00:00:00 2001
From: Tobias Lindberg <tobias.ehlert@gmail.com>
Date: Wed, 31 Jan 2024 00:37:54 +0000
Subject: [PATCH] add support for extra class in menu links (#834)
---
docs/configurations.md | 1 +
layouts/partials/header.html | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/docs/configurations.md b/docs/configurations.md
index 36f0394..0a0b534 100644
--- a/docs/configurations.md
+++ b/docs/configurations.md
@@ -173,6 +173,7 @@
| name | string | Yes | Menu Item name. | `"Posts"` |
| weight | int | Yes | Menu Item order. | `1` |
| url | string | Yes | URL to redirect. | `"/posts/"` |
+| class | string | No | Menu Item extra class attribute. | `"menu-item"` |
| target | string | No | URL target attribute. | `"_blank"` |
| rel | string | No | URL rel attribute. | `"alternate"` |
| type | string | No | URL type attribute. | `"application/rss+xml"` |
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 223d226..1ed35d8 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -12,7 +12,7 @@
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
- <a class="navigation-link" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
+ <a class="navigation-link {{ .Params.class }}" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
--
Gitblit v1.10.0