Hi,
I want to parse url youtube url to get the query video id in shortcode. Here is my code
{{ $link := .Get "link"}}
{{ $url := urls.Parse $link }}
{{ $q := $url.Query }}
{{ printf "%#v" $link }}
{{ printf "%#v" $q.v }}
<div class="videos-wrapper mx-auto">
<div class="py-4">
<iframe class="mx-auto" width="560" height="315" src="https://www.youtube.com/embed/{{$q.v}}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
Shortcode
{{<embed-youtube link="https://www.youtube.com/watch?v=UIExg0IVJ24&t=272s&ab_channel=Anphabe" >}}
The problem is the value of query āvā was return [UIExg0IVJ24] in hugo. How can I get query value return only UIExg0IVJ24.
Thanks.