blorg: ignore draft pages
This commit is contained in:
parent
64b2b22270
commit
16ccafe8a3
2 changed files with 6 additions and 0 deletions
|
@ -197,6 +197,9 @@ func (c *Config) RenderLists(pages []*Page) error {
|
||||||
ms["Pages"] = pages
|
ms["Pages"] = pages
|
||||||
lists := map[string]map[string][]interface{}{"": map[string][]interface{}{"": nil}}
|
lists := map[string]map[string][]interface{}{"": map[string][]interface{}{"": nil}}
|
||||||
for _, p := range pages {
|
for _, p := range pages {
|
||||||
|
if p.BufferSettings["DRAFT"] != "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
mp := toMap(p.BufferSettings, p)
|
mp := toMap(p.BufferSettings, p)
|
||||||
if p.BufferSettings["DATE"] != "" {
|
if p.BufferSettings["DATE"] != "" {
|
||||||
lists[""][""] = append(lists[""][""], mp)
|
lists[""][""] = append(lists[""][""], mp)
|
||||||
|
|
|
@ -44,6 +44,9 @@ func NewPage(c *Config, path string, info os.FileInfo) (*Page, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Page) Render(path string) error {
|
func (p *Page) Render(path string) error {
|
||||||
|
if p.BufferSettings["DRAFT"] != "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
f, err := os.Create(path)
|
f, err := os.Create(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue