{{- $postTarget := printf "/sites/%v/posts" .site.ID -}} {{- if (ne .post.ID 0) -}} {{- $postTarget = printf "/sites/%v/posts/%v" .site.ID .post.ID -}} {{- end -}}