Skip to content

Commit

Permalink
Cleaned up conditional and prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-mon1 committed Feb 23, 2024
1 parent 02ce5c4 commit 5cbde4d
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions themes/digital.gov/layouts/shortcodes/youtube.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{{/* Embeds a youtube player into the page
{{/* <!-- prettier-ignore -->
Embeds a youtube player into the page
Use the share link on the youtube.com to get the id and start time

@param {string} id - the required youtube video id
@params {number} [start_time] - the optional start time in seconds for the video
@params {string} title - The required title of the video for screen reader accessibility


<!-- prettier-ignore -->
@example
{{< youtube id="Hvo7WVKvPGU" start_time"101" title="Youtube video title goes here"
>}}
Expand All @@ -19,13 +22,6 @@
class="video"
style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;"
>
<iframe
src="https://www.youtube.com/embed/{{ $id }}?start={{ if $start_time }}
{{ $start_time }}
{{ end }}"
title="{{ $title }}"
style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
allowfullscreen=""
frameborder="0"
></iframe>
<!-- prettier-ignore -->
<iframe src="https://www.youtube.com/embed/{{ $id }}{{ if $start_time }}?start={{ $start_time }}{{ end }}" title="{{ $title }}" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen="" frameborder="0" ></iframe>
</div>

0 comments on commit 5cbde4d

Please sign in to comment.