I use prebuild
to create some markdown files.
now I want to render a shortcode in the file
{{ $content := "" }}
{{ range sort $book_list "Title" "asc" }} {{/* this is from json data */}}
{{/* 1. render Headlines */}}
{{ $content = printf "## %s\n\n" .Title | printf "%s%s" $content | printf "%s" }}
{{/* 2. Render a Shortcode */}}
{{ $content = printf "{{< book title='%s' author='%s' isbn='%s'>}}\n\n" .Title .Author .ISBN | printf "%s%s" $content | printf "%s" }}
{{ end }}
{{ $file = $content | resources.FromString "books/book-list.md" }}
{{ $output := $file.RelPermalink }}
So here I get in trouble because it renders nicely to:
## Camp concentration
{{< book title='Camp concentration' author='Thomas M. Disch' isbn='3453308009'>}}
but Hugo needs " "
for the shortcode parameters to work
{{< book title="Camp concentration" author="Thomas M. Disch" isbn="3453308009">}}
How can I use printf " with="..." inside"
?
Normally I would use \"
but that doesn’t work.