Skip to content

Commit

Permalink
Actions video (github#16744)
Browse files Browse the repository at this point in the history
* Support video frontmatter

* Add CSP rule

* Actually put in the video
  • Loading branch information
JasonEtco authored Dec 3, 2020
1 parent c0b7195 commit a7466b6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions content/actions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ changelog:
- title: Self-Hosted Runner Group Access Changes
date: '2020-10-16'
href: https://github.blog/changelog/2020-10-16-github-actions-self-hosted-runner-group-access-changes/

product_video: https://www.youtube-nocookie.com/embed/cP0I9w2coGU

redirect_from:
- /articles/automating-your-workflow-with-github-actions/
Expand Down
17 changes: 15 additions & 2 deletions layouts/product-landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
{% include header %}

<div class="container-xl px-3 px-md-6 pt-3 pb-2">
<header class="d-flex gutter mb-6">
<div class="col-12 col-lg-7">
<header class="d-lg-flex gutter-lg mb-6">
<div class="col-12 col-lg-6 mb-2 mb-lg-0">
<span class="text-mono text-gray">Product</span>
<h1 class="mb-3 font-mktg">{{ page.shortTitle }}</h1>
<div class="lead-mktg text-gray">{{ page.intro }}</div>
Expand All @@ -23,6 +23,19 @@ <h1 class="mb-3 font-mktg">{{ page.shortTitle }}</h1>
{% data ui.product_landing.reference_guides %}
</a>
</div>

{% if page.product_video %}
<div class="col-12 col-lg-6">
<div class="position-relative" style="padding-bottom:56.25%;">
<iframe
class="top-0 left-0 position-absolute box-shadow-large rounded-1 width-full height-full"
src="{{ page.product_video }}"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen
></iframe>
</div>
</div>
{% endif %}
</header>

<!-- Article links -->
Expand Down
5 changes: 5 additions & 0 deletions lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ const schema = {
}
}
},
// Show in `product-landing.html`
product_video: {
type: 'string',
format: 'url'
},
interactive: {
type: 'boolean'
}
Expand Down
3 changes: 2 additions & 1 deletion middleware/csp.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ module.exports = contentSecurityPolicy({
],
frameSrc: [ // exceptions for GraphQL Explorer
'https://graphql-explorer.githubapp.com', // production env
'http://localhost:3000' // development env
'http://localhost:3000', // development env
'https://www.youtube-nocookie.com'
],
styleSrc: [
"'self'",
Expand Down

0 comments on commit a7466b6

Please sign in to comment.