Export Document.FrontMatter
This commit is contained in:
parent
ceff4d1205
commit
5b88d13052
10
document.go
10
document.go
@ -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()),
|
||||
},
|
||||
})
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user