Hugo: Allow defining asciidoc attributes to pass to invocation of asciidoctor

Created on 14 Nov 2017  路  3Comments  路  Source: gohugoio/hugo

So asciidoctor has attributes you can set on the command line to set globally

i.e.

:icons: font
:iconsdir: /images/icons

which can be set by in CLI usage like:

asciidoctor -a icons=font -a iconsdir=/images/icons

So instead of putting in the two attributes in every file, it can just be globally set.

Looking at https://github.com/gohugoio/hugo/blob/8717a60cc030f4310c1779c0cdd51db37ad636cd/helpers/content.go#L601

I don't see any way to pass along extra arguments

It would be nice if there was some sort of config level option in hugo to pass extra parameters to external helpers.

NeedsUserFeedback

Most helpful comment

Not being able to pass global AsciiDoc attributes to Asciidoctor severely limits its usefulness. There are certain attributes you don't even want to set per document because they are a publishing detail.

Rather than adding additional configuration for AsciiDoc / Asciidoctor, you may just consider allowing the arguments to the asciidoctor command to be controlled. This would not only allow global attributes to be set (the -a flag), but also make it possible to load extensions (-r flag).

All 3 comments

There has been a recent discussion about this.

Not being able to pass global AsciiDoc attributes to Asciidoctor severely limits its usefulness. There are certain attributes you don't even want to set per document because they are a publishing detail.

Rather than adding additional configuration for AsciiDoc / Asciidoctor, you may just consider allowing the arguments to the asciidoctor command to be controlled. This would not only allow global attributes to be set (the -a flag), but also make it possible to load extensions (-r flag).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MunifTanjim picture MunifTanjim  路  3Comments

VoidingWarranties picture VoidingWarranties  路  3Comments

ianbrandt picture ianbrandt  路  3Comments

kaushalmodi picture kaushalmodi  路  3Comments

chrissparksnj picture chrissparksnj  路  3Comments