Feat: modify draft menu item rendering logic in mobile header (#99)

This commit is contained in:
Cell
2022-04-21 09:51:09 +08:00
parent 8e43786695
commit 29f8b4fa26
3 changed files with 3 additions and 3 deletions
@@ -1082,7 +1082,7 @@ This helps to distinguish the different contents of preview environment and prod
For example:
- [preview environment with draft menu items](https://fixit-1uivrlhmq-lruihao.vercel.app)
- [preview environment with draft menu items](https://fixit-obuxwqlr6-lruihao.vercel.app)
- [production environment without draft menu items](https://fixit.lruihao.cn)
{{< /admonition >}}
@@ -1093,7 +1093,7 @@ Hugo 有一个简单而强大的 [菜单系统](https://gohugo.io/content-manage
例如:
- [有草稿菜单的预览环境](https://fixit-1uivrlhmq-lruihao.vercel.app)
- [有草稿菜单的预览环境](https://fixit-obuxwqlr6-lruihao.vercel.app)
- [没有草稿菜单的生产环境](https://fixit.lruihao.cn)
{{< /admonition >}}
+1 -1
View File
@@ -215,7 +215,7 @@
{{- with .Page -}}
{{- $url = .RelPermalink -}}
{{- end -}}
{{- if (ne hugo.Environment "production") | or (ne .Params.Draft true) -}}
{{- if (ne .Params.Draft true) | or $BuildDrafts -}}
<li
class="menu-item{{ if $.IsMenuCurrent `main` . | or ($.HasMenuCurrent `main` .) | or (eq $.RelPermalink $url) }} active{{ end }}{{ with .Params.Class }} {{ . }}{{ end }}"
>