I think I’ve encountered a bug, but I’d like to double check. I attempted to add validation to an inline shortcode using errorf and it caused Hugo to raise an error even though the shortcode was used correctly.
Here’s a minimal repro. The presence of this inline shortcode in a content file will cause a warning, even though it’s never used.
It seems that the shortcode is invoked even though it is never used. And since that invocation doesn’t provide parameters it cause the warning to fire.
Oh, that makes more sense. That’s more clear upon re-reading the docs.
Is it possible to pass arguments to the definition of an inline shortcode? It’s not discussed in the docs. I can definitely pass arguments in subsequent uses, but I don’t know the syntax to do so in the initial definition.
Do inline shortcodes support .Inner? This second use of the shortcode doesn’t work, despite being the same syntax that works when the shortcode isn’t inlined.