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.
|
// Document represents a STEP file.
|
||||||
type Document struct {
|
type Document struct {
|
||||||
Author string
|
Author string
|
||||||
Title string
|
Title string
|
||||||
Extends string
|
Extends string
|
||||||
|
FrontMatter FrontMatter
|
||||||
|
|
||||||
// WORM:
|
// WORM:
|
||||||
environment *Environment
|
environment *Environment
|
||||||
frontMatter FrontMatter
|
|
||||||
name string
|
name string
|
||||||
parseTime time.Time
|
parseTime time.Time
|
||||||
template *template.Template
|
template *template.Template
|
||||||
@ -41,7 +41,7 @@ func (this *Document) Execute (output io.Writer, data ExecutionData) error {
|
|||||||
Author: this.Author,
|
Author: this.Author,
|
||||||
Title: this.Title,
|
Title: this.Title,
|
||||||
Extends: this.Extends,
|
Extends: this.Extends,
|
||||||
FrontMatter: this.frontMatter,
|
FrontMatter: this.FrontMatter,
|
||||||
Body: template.HTML(outputBuilder.String()),
|
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
|
// assemble the document struct
|
||||||
document := &Document {
|
document := &Document {
|
||||||
|
FrontMatter: frontMatter,
|
||||||
environment: this,
|
environment: this,
|
||||||
name: name,
|
name: name,
|
||||||
parseTime: time.Now(),
|
parseTime: time.Now(),
|
||||||
frontMatter: frontMatter,
|
|
||||||
template: template.New(name),
|
template: template.New(name),
|
||||||
}
|
}
|
||||||
if author, ok := frontMatter["author"]; ok {
|
if author, ok := frontMatter["author"]; ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user