base64
少于1分钟
将以下英文翻译为中文:
base64
https://gohugo.io/functions/base64/
base64Encode and base64Decode let you easily decode content with a base64 encoding and vice versa through pipes.
语法
base64Decode INPUT
base64Encode INPUT
{{ "Hugo" | base64Encode }} → "SHVnbw=="
{{ "SHVnbw==" | base64Decode }} → "Hugo"
base64 with APIs
Using base64 to decode and encode becomes really powerful if we have to handle responses from APIs.
| |
The response of the GitHub API contains the base64-encoded version of the README.md in the Hugo repository. Now we can decode it and parse the Markdown. The final output will look similar to the rendered version on GitHub.
最后修改 June 1, 2023: 新增一个配置参数:sidebar_menu_truncate = 500 用于解决菜单不全的问题 (27810f1)