Skip to content

Commit ba5638d

Browse files
committed
Anonymous Update
1 parent 741af22 commit ba5638d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

markup/pandoc/convert.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import (
2222
"github.com/gohugoio/hugo/markup/internal"
2323

2424
"github.com/gohugoio/hugo/markup/converter"
25+
26+
"path"
2527
)
2628

2729
// Provider is the package entry point.
@@ -55,8 +57,8 @@ func (c *pandocConverter) Supports(feature identity.Identity) bool {
5557
// getPandocContent calls pandoc as an external helper to convert pandoc markdown to HTML.
5658
func (c *pandocConverter) getPandocContent(src []byte, ctx converter.DocumentContext) []byte {
5759
logger := c.cfg.Logger
58-
path := getPandocExecPath()
59-
if path == "" {
60+
pandoc_path := getPandocExecPath()
61+
if pandoc_path == "" {
6062
logger.Println("pandoc not found in $PATH: Please install.\n",
6163
" Leaving pandoc content unrendered.")
6264
return src
@@ -74,7 +76,9 @@ func (c *pandocConverter) getPandocContent(src []byte, ctx converter.DocumentCon
7476
arguments = append(arguments, "--csl", bibliography.CitationStyle)
7577
}
7678

77-
return internal.ExternallyRenderContent(c.cfg, ctx, src, path, arguments)
79+
arguments = append(arguments, "--resource-path", path.Dir(ctx.Filename))
80+
81+
return internal.ExternallyRenderContent(c.cfg, ctx, src, pandoc_path, arguments)
7882
}
7983

8084
func getPandocExecPath() string {

0 commit comments

Comments
 (0)