diff --git a/dir.go b/dir.go index b622819..f84bdc8 100644 --- a/dir.go +++ b/dir.go @@ -16,13 +16,14 @@ import ( // Dir represents a directory. type Dir struct { - Title string // Directory title. - Content string // Directory index content. - Path string // Directory path. - Pages []*Page // Pages in this directory. - Dirs []*Dir // Subdirectories. - index *Page // The index page. - feed []byte // Atom feed. + Title string + Date time.Time + Content string + Path string + Pages []*Page + Dirs []*Dir + index *Page // The index page. + feed []byte // Atom feed. } // NewDir returns a new Dir with the given path. @@ -76,6 +77,7 @@ func (d *Dir) read(srcDir, path string, task *Task) error { if strings.TrimSuffix(name, ext) == "index" { d.index = NewPage(d.Path, content) d.Title = d.index.Title + d.Date = d.index.Date d.Content = d.index.Content } else { d.Pages = append(d.Pages, NewPage(path, content))