mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
Adding IsNode & IsPage functions to Page & Node
This commit is contained in:
@@ -47,6 +47,14 @@ func (n *Node) RSSlink() template.HTML {
|
||||
return n.RSSLink
|
||||
}
|
||||
|
||||
func (n *Node) IsNode() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (n *Node) IsPage() bool {
|
||||
return !n.IsNode()
|
||||
}
|
||||
|
||||
type UrlPath struct {
|
||||
Url string
|
||||
Permalink template.HTML
|
||||
|
@@ -85,6 +85,14 @@ func (p *Page) Plain() string {
|
||||
return p.plain
|
||||
}
|
||||
|
||||
func (p *Page) IsNode() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *Page) IsPage() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (p *Page) setSummary() {
|
||||
if bytes.Contains(p.rawContent, summaryDivider) {
|
||||
// If user defines split:
|
||||
|
Reference in New Issue
Block a user