IsHome
Page
物件的 IsHome
方法,當 頁面類型 為 home
時,回傳 true
。
以下是目錄結構範例:
content/
├── books/
│ ├── book-1/
│ │ └── index.md <-- 類型 = page
│ ├── book-2.md <-- 類型 = page
│ └── _index.md <-- 類型 = section
└── _index.md <-- 類型 = home
在 Go HTML 模板中的使用範例:
{{ .IsHome }}