Export Document.FrontMatter

This commit is contained in:
Sasha Koshka 2024-12-06 02:00:08 -05:00
parent ceff4d1205
commit 5b88d13052
2 changed files with 6 additions and 6 deletions

View File

@ -7,13 +7,13 @@ import "html/template"
// Document represents a STEP file.
type Document struct {
Author string
Title string
Extends string
Author string
Title string
Extends string
FrontMatter FrontMatter
// WORM:
environment *Environment
frontMatter FrontMatter
name string
parseTime time.Time
template *template.Template
@ -41,7 +41,7 @@ func (this *Document) Execute (output io.Writer, data ExecutionData) error {
Author: this.Author,
Title: this.Title,
Extends: this.Extends,
FrontMatter: this.frontMatter,
FrontMatter: this.FrontMatter,
Body: template.HTML(outputBuilder.String()),
},
})

View File

@ -91,10 +91,10 @@ func (this *Environment) parse (name string, modTime time.Time, input io.Reader)
// assemble the document struct
document := &Document {
FrontMatter: frontMatter,
environment: this,
name: name,
parseTime: time.Now(),
frontMatter: frontMatter,
template: template.New(name),
}
if author, ok := frontMatter["author"]; ok {