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