Shortcode error: bad character U+0022

I’m trying to make a shortcode with two parameters, a CSS class and a Tweet ID. I want to use it like this in

{{< tweet-single class="alignright" id="1225240565509316608" >}}

to produce the html:

<div class="tweet-in-post alignright">
<twitter-widget class=....

but using this in tweet-single.html

<!-- tweet-single -->

<div class="tweet-in-post {{ .Get "class" }}">

{{ (getJSON "{{ .Get "id" }}" }}


gives me the error bad character U+0022 ‘"’.

How can I get this shortcode to work?

There are syntax errors in the line above, you cannot have double brackets within double brackets. Also a fuction can be within a parentheses only if it is nested within another function.

I know I have errors; but how do I fix it? :slight_smile:

The docs has examples with using getJSON and urls.

I see the docs, but there are no examples of how to use multiple inputs, i.e. arg1 and arg 2

{{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }}

in a shortcode.