{"id":"8d15b1a4ec12350b","repo":"gohugoio/hugo","slug":"pandoc-not-found-in-path-cannot-render-q","errorCode":null,"errorMessage":"pandoc not found in $PATH, cannot render %q","messagePattern":"pandoc not found in \\$PATH, cannot render %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"markup/pandoc/convert.go","lineNumber":63,"sourceCode":"}\n\nfunc (c *pandocConverter) Convert(ctx converter.RenderContext) (converter.ResultRender, error) {\n\tb, err := c.getPandocContent(ctx.Src, c.ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn converter.Bytes(b), nil\n}\n\nfunc (c *pandocConverter) Supports(feature identity.Identity) bool {\n\treturn false\n}\n\n// getPandocContent calls pandoc as an external helper to convert pandoc markdown to HTML.\nfunc (c *pandocConverter) getPandocContent(src []byte, ctx converter.DocumentContext) ([]byte, error) {\n\tbinaryName := getPandocBinaryName()\n\tif binaryName == \"\" {\n\t\treturn nil, fmt.Errorf(\"pandoc not found in $PATH, cannot render %q\", ctx.DocumentName)\n\t}\n\targs := []string{\"--mathjax\", \"--citeproc\"}\n\treturn internal.ExternallyRenderContent(c.cfg, ctx, src, binaryName, args)\n}\n\nconst pandocBinary = \"pandoc\"\n\nfunc getPandocBinaryName() string {\n\tif hexec.InPath(pandocBinary) {\n\t\treturn pandocBinary\n\t}\n\treturn \"\"\n}\n\n// Supports returns whether Pandoc is installed on this computer.\nfunc Supports() bool {\n\thasBin := getPandocBinaryName() != \"\"\n\tif htesting.SupportsAll() {","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/markup/pandoc/convert.go#L45-L81","documentation":"Hugo renders Pandoc-flavored content by shelling out to the external `pandoc` binary. Before spawning it, `getPandocContent` checks `hexec.InPath(\"pandoc\")`; if the binary isn't on $PATH the page cannot be converted and the build fails with the document name that triggered it.","triggerScenarios":"Building a site containing a content file with a `.pad`/`.pdc` extension (or `markup: pandoc` in front matter) on a machine where the `pandoc` executable is not resolvable via $PATH at Hugo's process start.","commonSituations":"CI containers and the official Hugo Docker images that don't include pandoc; pandoc installed after starting `hugo server` (PATH is snapshotted); pandoc installed via a user-local path not exported to the environment running Hugo; Netlify/Vercel builds missing an install step.","solutions":["Install pandoc and ensure it's on $PATH for the Hugo process (e.g. `apt-get install pandoc` in CI, `brew install pandoc` locally), then restart `hugo server`.","In CI, add a pandoc install step before the Hugo build, or use an image that bundles it.","If pandoc isn't wanted, change the offending content file's markup to goldmark markdown (rename to .md or set `markup: goldmark`).","Note Hugo's security policy must also allow executing pandoc (`security.exec.allow`)."],"exampleFix":"# before (CI)\nhugo --minify\n# after (CI)\napt-get update && apt-get install -y pandoc\nhugo --minify","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"pandoc\"); err != nil {\n    return fmt.Errorf(\"pandoc required for .pad/.pandoc content but not installed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install pandoc and ensure it's on $PATH in every build environment, including CI containers","Add a preflight check (exec.LookPath or `pandoc --version`) to build scripts","Whitelist pandoc in Hugo's security.exec.allow config","Avoid pandoc-format content files if you cannot guarantee the binary in all environments"],"tags":["hugo","pandoc","external-binary","path","environment"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}