Slug
返回给定页面在 front matter 中定义的 URL slug。
Syntax
PAGE.Slug
Returns
string
---
slug: sushi
title: How to make spicy tuna hand rolls
---+++
slug = 'sushi'
title = 'How to make spicy tuna hand rolls'
+++{
"slug": "sushi",
"title": "How to make spicy tuna hand rolls"
}
此页面将从以下位置提供服务:
https://example.org/recipes/sushi
要在模板中获取 slug 值:
{{ .Slug }} → sushi