Page

Kind

返回给定页面的种类。

签名
PAGE.Kind
返回类型
string

页面种类是 home、page、section、taxonomy 或 term 之一。

content/
├── books/
│   ├── book-1/
│   │   └── index.md    <-- kind = page
│   ├── book-2.md       <-- kind = page
│   └── _index.md       <-- kind = section
├── tags/
│   ├── fiction/
│   │   └── _index.md   <-- kind = term
│   └── _index.md       <-- kind = taxonomy
└── _index.md           <-- kind = home

在模板中取值:

{{ .Kind }}