mirror of
https://github.com/danog/gojekyll.git
synced 2025-01-22 23:11:26 +01:00
Render non-collection pages
This commit is contained in:
parent
c170df0ce5
commit
44a04c41fb
@ -70,11 +70,14 @@ func (s *Site) readFiles(dir, base string) error {
|
||||
return utils.WrapPathError(err, filename)
|
||||
}
|
||||
s.AddDocument(d, true)
|
||||
if p, ok := d.(pages.Page); ok {
|
||||
s.nonCollectionPages = append(s.nonCollectionPages, p)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// AddDocument adds a document to the site structures.
|
||||
// AddDocument adds a document to the site's fields.
|
||||
// It ignores unpublished documents unless config.Unpublished is true.
|
||||
func (s *Site) AddDocument(d pages.Document, output bool) {
|
||||
if d.Published() || s.config.Unpublished {
|
||||
|
@ -16,6 +16,11 @@ func (s *Site) Render() error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
for _, c := range s.nonCollectionPages {
|
||||
if err := c.Render(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ type Site struct {
|
||||
themeDir string
|
||||
|
||||
docs []pages.Document // all documents, whether or not they are output
|
||||
nonCollectionPages []pages.Page
|
||||
|
||||
pipeline *pipelines.Pipeline
|
||||
renderOnce sync.Once
|
||||
|
Loading…
x
Reference in New Issue
Block a user