after
少于1分钟
将以下英文翻译为中文:
after
https://gohugo.io/functions/after/
after slices an array to only the items after the Nth item.
语法
after INDEX COLLECTION
The following shows after being used in conjunction with the slice function:
| |
Example of after with first: 2nd–4th Most Recent Articles
You can use after in combination with the first function and Hugo’s powerful sorting methods. Let’s assume you have a list page at example.com/articles. You have 10 articles, but you want your templating for the list/section page to show only two rows:
- The top row is titled “Featured” and shows only the most recently published article (i.e. by
publishdatein the content files’ front matter). - The second row is titled “Recent Articles” and shows only the 2nd- to 4th-most recently published articles.
layouts/section/articles.html
| |
另请参阅
最后修改 June 1, 2023: 新增一个配置参数:sidebar_menu_truncate = 500 用于解决菜单不全的问题 (27810f1)