IsNode
语法
PAGE.IsNode
返回
bool
如果页面类型是home
、section
、taxonomy
或term
,则Page
对象上的IsNode
方法返回true
。
如果页面类型是page
,则返回false
。
content/
├── books/
│ ├── book-1/
│ │ └── index.md <-- kind = page, node = false
│ ├── book-2.md <-- kind = page, node = false
│ └── _index.md <-- kind = section, node = true
├── tags/
│ ├── fiction/
│ │ └── _index.md <-- kind = term, node = true
│ └── _index.md <-- kind = taxonomy, node = true
└── _index.md <-- kind = home, node = true
{{ .IsNode }}