mirror of
https://github.com/danog/gojekyll.git
synced 2024-11-27 05:44:38 +01:00
Recompute Page.Published()
This commit is contained in:
parent
fdfe64126c
commit
a3ff348d3c
8
page.go
8
page.go
@ -37,7 +37,6 @@ type Page interface {
|
||||
type pageFields struct {
|
||||
path string // this is the relative path
|
||||
permalink string
|
||||
published bool
|
||||
frontMatter VariableMap
|
||||
}
|
||||
|
||||
@ -48,7 +47,10 @@ func (p *pageFields) String() string {
|
||||
|
||||
func (p *pageFields) Path() string { return p.path }
|
||||
func (p *pageFields) Permalink() string { return p.permalink }
|
||||
func (p *pageFields) Published() bool { return p.published }
|
||||
|
||||
func (p *pageFields) Published() bool {
|
||||
return p.frontMatter.Bool("published", true)
|
||||
}
|
||||
|
||||
// StaticPage is a static page.
|
||||
type StaticPage struct {
|
||||
@ -169,7 +171,6 @@ func makeDynamicPage(path string, defaults VariableMap, source []byte, match []i
|
||||
pageFields: pageFields{
|
||||
path: path,
|
||||
permalink: permalink,
|
||||
published: frontMatter.Bool("published", true),
|
||||
frontMatter: frontMatter,
|
||||
},
|
||||
Content: body,
|
||||
@ -183,7 +184,6 @@ func makeStaticPage(path string, frontMatter VariableMap) (*StaticPage, error) {
|
||||
pageFields: pageFields{
|
||||
path: path,
|
||||
permalink: permalink,
|
||||
published: frontMatter.Bool("published", true),
|
||||
frontMatter: frontMatter,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user