How to render variable inside url that I want to fetch?

{{ range . }}
<h4>{{ .Name }}</h4> //works fine
{{ with resources.GetRemote "https://example-api.com/name-{{ .Name }}" }}
{{ end }} {{ end }}

This {{ .Name }} parameter can’t render, it stays in link like “{{ .Name }}”. I tried everything, how can I make it to be recognized as variable inside this URL?

{{ range . }}
<h4>{{ .Name }}</h4> //works fine
{{ $url := print "https://example-api.com/name-" .Name }}
{{ with resources.GetRemote $url }}
{{ end }} {{ end }}
2 Likes

Thank you very much, it works now perfectly :hearts:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.