Page

Slug

返回给定页面前置元数据中定义的 URL slug。

签名
PAGE.Slug
返回类型
string
title = 'How to make spicy tuna hand rolls'
slug = 'sushi'

该页面将通过以下地址访问:

https://example.org/recipes/sushi

要在模板中获取 slug 值:

{{ .Slug }} → sushi