isset
少于1分钟
将以下英文翻译为中文:
isset
https://gohugo.io/functions/isset/
Returns true if the parameter is set.
语法
isset COLLECTION INDEX
isset COLLECTION KEY
Takes either a slice, array, or channel and an index or a map and a key as input.
| |
All site-level configuration keys are stored as lower case. Therefore, a myParam key-value set in your site configuration file needs to be accessed with {{ if isset .Site.Params "myparam" }} and not with {{ if isset .Site.Params "myParam" }}. Note that you can still access the same config key with .Site.Params.myParam or .Site.Params.myparam, for example, when using with. This restriction also applies when accessing page-level front matter keys from within shortcodes.
最后修改 June 1, 2023: 新增一个配置参数:sidebar_menu_truncate = 500 用于解决菜单不全的问题 (27810f1)