klakegg/docker-hugo

Issues with pandoc vs pandoc-default?

brianhou opened this issue · 3 comments

Thanks for this great set of Docker images!

I've been having some issues getting this work correctly with pandoc. (Pandoc is specified in the front matter with markup: pandoc, and I only need the default mathjax flag.)

$ docker run --rm -it -v $(pwd):/src -p 1313:1313 klakegg/hugo:0.81.0-ext-pandoc server
Start building sites …
pandoc not found in $PATH: Please install.
                  Leaving pandoc content unrendered.

It seems that this is an issue with pandoc-default vs pandoc. Hugo is looking directly for pandoc, and the pandoc alias doesn't seem to work because it isn't on the PATH for Hugo to pick up.

For now, I've been able to solve the problem by adding a symlink from pandoc-default to pandoc. Here's the relevant snippet of my working GitLab configuration (which uses 0.77.0, but had the same issue):

image: klakegg/hugo:0.77.0-ext-pandoc-ci

pages:
  stage: deploy
  script:
    - ln -s /bin/pandoc-default /bin/pandoc
    - hugo -D

Am I using this correctly? Thank you for any suggestions you might have!

Thank you for making me aware of this issue.

Your description of the problem is correct, my solution using an alias does not work when Hugo explicitly inspects PATH to find Pandoc. Your workaround clearly does the trick, however I prefer a more permanent solution. 😄

I've reimplemented support for Pandoc by using a script to still support HUGO_PANDOC for customization. The new solution may be tested using edge images, for you I've made available klakegg/hugo:egde-ext-pandoc and klakegg/hugo:egde-ext-pandoc-ci to test my updated solution while still using the variants you are used to.

My tests indicate the new solution works as expected, could you please verify in your environment?

Confirming that both edge images work for me, thank you very much for the fast response!

Updated images bundling Hugo 0.82.0 are building right now, meaning I've removed pushing of the extra images added as part of this issue, and I plan to delete the tags on Docker Hub a bit later (around next Hugo release unless it is too quick). Please make sure to update your build configuration in time, and thank you again for your help. 😄