Skip to content

Commit

Permalink
Handle download link for videos
Browse files Browse the repository at this point in the history
  • Loading branch information
solarsailer committed Aug 14, 2018
1 parent 87398dc commit 33f858d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
14 changes: 12 additions & 2 deletions assets/_includes/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2 id="videos">Videos</h2>
<div>
{{#youtube}}
<p>
<strong>{{../name}}</strong> <a href="https://www.youtube.com/embed/{{trim .}}?rel=0">YouTube</a>
<strong>{{../name}}</strong> <a href="https://www.youtube.com/embed/{{trim .}}?rel=0">YouTube</a> {{#if ../download}}| <a href="{{../download}}" target="_blank">Download</a>{{/if}}
</p>

<div class="video-player">
Expand All @@ -16,13 +16,23 @@ <h2 id="videos">Videos</h2>

{{#vimeo}}
<p>
<strong>{{../name}}</strong> <a href="https://player.vimeo.com/video/{{trim .}}">Vimeo</a>
<strong>{{../name}}</strong> <a href="https://player.vimeo.com/video/{{trim .}}">Vimeo</a> {{#if ../download}}| <a href="{{../download}}" target="_blank">Download</a>{{/if}}
</p>

<div class="video-player">
<iframe class="video-player__frame" src="https://player.vimeo.com/video/{{trim .}}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
{{/vimeo}}

{{#unless youtube}}
{{#unless vimeo}}
{{#download}}
<p>
<strong>{{../name}}</strong><a href="{{../download}}" target="_blank">Download</a>
</p>
{{/download}}
{{/unless}}
{{/unless}}
</div>
{{/each}}
</section>
Expand Down
16 changes: 16 additions & 0 deletions data/data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@
You can use YouTube and/or Vimeo. Only one is needed, and only one is recommended.
Don't put the full link: just the ID is necessary.
If you want to provide a link to download the video, add this tag in `<trailer>`:
```
<download>https://example.com/video.mp4</download>
```
-->
<trailers>
<trailer>
Expand All @@ -134,6 +140,16 @@
<youtube>YH3c1QZzRK4</youtube>
<vimeo>108650530</vimeo>
</trailer>

<!--
You can also add a video link without YouTube or Vimeo.
In this case, only a sentence will be shown, along with a download link.
-->
<trailer>
<name>Gameplay Preview: Beta 42</name>
<download>https://github.com/pixelnest/presskit.html</download>
</trailer>
</trailers>

<!-- ## Awards, quotes & links -->
Expand Down

0 comments on commit 33f858d

Please sign in to comment.