diff options
author | Jimmy Cai <github@jimmycai.com> | 2021-10-23 10:18:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 10:18:44 +0300 |
commit | 7c59ac77137a9bbf2d9b4430aeca7006fb044da0 (patch) | |
tree | 0a84ea3ba5624c934d9a2a5a03734c5525ec1444 /layouts | |
parent | a822411a030663c8acaf399c349b7462da467d92 (diff) |
refactor(menu): use .Params.icon to configure menu item icon (#400)
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/sidebar/left.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/layouts/partials/sidebar/left.html b/layouts/partials/sidebar/left.html index 53a6655..9d4dd3e 100644 --- a/layouts/partials/sidebar/left.html +++ b/layouts/partials/sidebar/left.html @@ -40,8 +40,12 @@ <li {{ if $active }} class='current' {{ end }}> <a href='{{ .URL | relLangURL }}' {{ if eq .Params.newTab true }}target="_blank"{{ end }}> + {{ $icon := default .Pre .Params.Icon }} {{ if .Pre }} - {{ partial "helper/icon" .Pre }} + {{ warnf "Menu item [%s] is using [pre] field to set icon, please use [params.icon] instead.\nMore information: https://docs.stack.jimmycai.com/configuration/custom-menu.html" .URL }} + {{ end }} + {{ with $icon }} + {{ partial "helper/icon" . }} {{ end }} <span>{{- .Name -}}</span> </a> |