# Hugo how to use " in printf

**URL:** <https://discourse.gohugo.io/t/hugo-how-to-use-in-printf/53180>\
**Category:** support\
**Created:** [January 18, 2025, 3:11pm UTC](https://discourse.gohugo.io/t/hugo-how-to-use-in-printf/53180 "2025-01-18T15:11:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnichte](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/cnichte/32/20849_2.png) [@cnichte](https://discourse.gohugo.io/u/cnichte)\
**Post date:** [January 18, 2025, 3:11pm UTC](https://discourse.gohugo.io/t/hugo-how-to-use-in-printf/53180/1 "2025-01-18T15:11:26Z")

</div>

I use `prebuild` to create some markdown files.

now I want to render a shortcode in the file

```auto
{{ $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:

```auto
## Camp concentration

{{< book title='Camp concentration' author='Thomas M. Disch' isbn='3453308009'>}}

```

but Hugo needs `" "` for the shortcode parameters to work

```auto
{{< 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.

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [January 18, 2025, 3:16pm UTC](https://discourse.gohugo.io/t/hugo-how-to-use-in-printf/53180/2 "2025-01-18T15:16:51Z")

</div>

You can use string literals:

```auto
{{ printf `Hello "%s"` "world" }}

```
