| 1 |
--- |
| 2 |
title: Kind |
| 3 |
description: Returns the kind of the given page. |
| 4 |
categories: [] |
| 5 |
keywords: [] |
| 6 |
params: |
| 7 |
functions_and_methods: |
| 8 |
returnType: string |
| 9 |
signatures: [PAGE.Kind] |
| 10 |
--- |
| 11 |
|
| 12 |
The [page kind](g) is one of `home`, `page`, `section`, `taxonomy`, or `term`. |
| 13 |
|
| 14 |
```tree |
| 15 |
content/ |
| 16 |
├── books/ |
| 17 |
│ ├── book-1/ |
| 18 |
│ │ └── index.md <-- kind = page |
| 19 |
│ ├── book-2.md <-- kind = page |
| 20 |
│ └── _index.md <-- kind = section |
| 21 |
├── tags/ |
| 22 |
│ ├── fiction/ |
| 23 |
│ │ └── _index.md <-- kind = term |
| 24 |
│ └── _index.md <-- kind = taxonomy |
| 25 |
└── _index.md <-- kind = home |
| 26 |
``` |
| 27 |
|
| 28 |
To get the value within a template: |
| 29 |
|
| 30 |
```go-html-template |
| 31 |
{{ .Kind }} |
| 32 |
``` |