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