Provide asciidoc/asciidoctor on the builder nodes

Hugo support writing documents in asciidoc and not only in markdown.

However, in order to compile the asciidoc documents hugo requires either asciidoc or asciidoctor available in the path.

Would it be possible to install one of those packages in the build nodes?

Overall asciidoc is more popular when people are working on more extensive and coherent material (think about a book) that a serie of blog posts.

Provided a PR here: add asciidoctor to the build node, useful for hugo by siscia Ā· Pull Request #391 Ā· netlify/build-image Ā· GitHub

Thanks for the PR, but I am curious as to why you donā€™t use the npm package to install it - you can do that with no changes:

We try not to add tools to the image that are installable in other ways. LMK if that wonā€™t work for you!

Hello there!

Thanks for your answer. That tool over there is not asciidoctor nor it seems to provide the same interface.

I just tried and the package does not work. It is a asciidoctor version transpilled from ruby to js to be used inside node.js

What it is needed by hugo is a correct executable in the system PATH

Cheers,

OK, Iā€™d suggest creating a feature request over here: Issues Ā· netlify/build-image Ā· GitHub

Weā€™ll need to see more than a few other folks who canā€™t use the node package echo that feature request, before weā€™ll be able to consider adding it to the build image, since we try very hard to keep it small and have only commonly needed tools ā€œbaked inā€ vs ā€œinstalledā€.

For a quicker-results workaround, you could compile or find a binary that works in ubuntu 16.04 x86_64 and add it to your repo and run directly (./asciidoctor && ā€¦)

I had the same problem. However, since asciidoctor is simply a ruby gem and the Netlify build process installs gems before building, this is actually really easy to solve:

  • Create a Gemfile at the root of your repo (a textfile with the name Gemfile)
  • Put the following two lines in the file:

source ā€˜https://rubygems.orgā€™
gem ā€˜asciidoctorā€™

Thatā€™s it. In the next build, asciidoctor should get installed automatically and hugo can use it.

2 Likes

Thanks so much for providing that solution! Really appreciate your help, @akbo