time.ParseDuration
少于1分钟
将以下英文翻译为中文:
time.ParseDuration
https://gohugo.io/functions/time.parseduration/
Parses a given duration string into a time.Duration structure.
语法
time.ParseDuration DURATION
time.ParseDuration parses a duration string into a time.Duration structure so you can access its fields. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, -1.5h or 2h45m. Valid time units are ns, us (or µs), ms, s, m, h.
You can perform time operations on the returned time.Duration value:
{{ printf "There are %.0f seconds in one day." (time.ParseDuration "24h").Seconds }}
<!-- Output: There are 86400 seconds in one day. -->
最后修改 June 1, 2023: 新增一个配置参数:sidebar_menu_truncate = 500 用于解决菜单不全的问题 (27810f1)