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: https://github.com/netlify/build-image/pull/391

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: https://github.com/netlify/build-image/issues

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