@@ -453,14 +453,15 @@ func ExtractTOC(content []byte) (newcontent []byte, toc []byte) {
453
453
// for a given content rendering.
454
454
// By creating you must set the Config, otherwise it will panic.
455
455
type RenderingContext struct {
456
- Frontmatter map [string ]interface {}
457
- Content []byte
458
- PageFmt string
459
- DocumentID string
460
- DocumentName string
461
- Config * BlackFriday
462
- RenderTOC bool
463
- Cfg config.Provider
456
+ Frontmatter map [string ]interface {}
457
+ FrontmatterRaw []byte
458
+ Content []byte
459
+ PageFmt string
460
+ DocumentID string
461
+ DocumentName string
462
+ Config * BlackFriday
463
+ RenderTOC bool
464
+ Cfg config.Provider
464
465
}
465
466
466
467
// RenderBytes renders a []byte.
@@ -721,8 +722,8 @@ func getPandocContent(ctx *RenderingContext) []byte {
721
722
pathCiteproc , errCiteproc := exec .LookPath ("pandoc-citeproc" )
722
723
if errCiteproc == nil {
723
724
if bib , ok := ctx .Frontmatter ["bibliography" ].(string ); ok {
724
- args = append (args , "--bibliography " , "content/" + bib )
725
- jww .INFO .Println ("Rendering bibliography " , bib , "with" , pathCiteproc , "..." )
725
+ args = append (args , "--filter " , "pandoc-citeproc" )
726
+ jww .INFO .Println ("Rendering bibliography" , bib , "with" , pathCiteproc , "..." )
726
727
}
727
728
}
728
729
@@ -737,7 +738,8 @@ func orgRender(ctx *RenderingContext, c ContentSpec) []byte {
737
738
}
738
739
739
740
func externallyRenderContent (ctx * RenderingContext , path string , args []string ) []byte {
740
- content := ctx .Content
741
+ content := ctx .FrontmatterRaw
742
+ content = append (content , ctx .Content ... )
741
743
cleanContent := bytes .Replace (content , SummaryDivider , []byte ("" ), 1 )
742
744
743
745
cmd := exec .Command (path , args ... )
0 commit comments