-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
5,698 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const isUrl = require('is-url'); | ||
|
||
module.exports = (eleventyConfig, options = {}) => { | ||
|
||
const defaultOptions = { | ||
mainScript: true, | ||
class: 'vidyard-player-embed', | ||
version: 4, | ||
type: 'inline' | ||
} | ||
|
||
const globalOptions = { ...defaultOptions, ...options }; | ||
|
||
eleventyConfig.addShortcode("vidyard", (videoURL, options = {}) => { | ||
if (!videoURL) { | ||
throw new Error( | ||
"[eleventy-plugin-vidyard] the videoURL must be specified" | ||
); | ||
} | ||
|
||
if (!isUrl(videoURL) || !videoURL.match('vidyard.com\/watch\/')) { | ||
throw new Error( | ||
`[eleventy-plugin-vidyard] the videoURL "${videoURL}" is not valid url` | ||
); | ||
} | ||
|
||
options = { ...globalOptions, ...options }; | ||
|
||
const UUID = videoURL.split('vidyard.com/watch/')[1].split('?')[0]; | ||
|
||
let $return = ''; | ||
|
||
if ( options.mainScript ) | ||
$return += '<script src="https://play.vidyard.com/embed/v4.js" type="text/javascript" async></script>'; | ||
|
||
$return += ` | ||
<img style="max-width: 100%;" | ||
class="${options.class}" | ||
src="https://play.vidyard.com/${UUID}.jpg" | ||
data-uuid="${UUID}" | ||
data-v="${options.version}" | ||
data-type="${options.type}" /> | ||
`; | ||
|
||
return $return; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# To avoid using raw blocks | ||
README.md | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Node.js Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- run: npm ci | ||
- run: npm test | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Eleventy Site Output | ||
_site | ||
|
||
# node modules | ||
node_modules | ||
|
||
# npm rc | ||
.npmrc | ||
|
||
# DS Store | ||
.DS_STORE | ||
|
||
# IDE | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 11ty site output | ||
demo/ | ||
_site/ | ||
# misc | ||
.eleventyignore | ||
.idea | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const eleventyPluginVidyard = require("../.eleventy.js"); | ||
|
||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.addPlugin(eleventyPluginVidyard, {}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
|
||
--- | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>11ty Plugin Feather Icons - Demo</title> | ||
<link rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/build/pure-min.css" | ||
integrity="sha384-yHIFVG6ClnONEA5yB5DJXfW2/KC173DIQrYoZMEtBvGzmf0PKiGyNEqe9N6BNDBH" | ||
crossorigin="anonymous"> | ||
<style> | ||
body { | ||
background: #fafafa; | ||
} | ||
.page-wrapper { | ||
background: #fff; | ||
max-width: 900px; | ||
margin: 0 auto; | ||
padding: 30px; | ||
box-shadow: 0 5px 20px rgba(0,0,0,.15); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="page page-wrapper"> | ||
|
||
<div class="content-wrapper"> | ||
<div class="content"> | ||
<div class="pure-g"> | ||
<div class="pure-u-1-1"> | ||
<h1>Vidyard Demo Video</h1> | ||
<p>The Vidyard embed code helps embed Vidyard players into web pages and applications. It provides programmatic playback control, the ability to listen on playback events, GDPR consent control and integration with third party MAP platforms.</p> | ||
</div> | ||
|
||
<div class="pure-u-1-1"> | ||
|
||
{% vidyard "https://share.vidyard.com/watch/Cse5Fqy1CpUWqYdtikKrFy?embeded=true" %} | ||
|
||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.