Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create filter to turn default youtube embed links into noocookie ones #15

Closed
javorszky opened this issue Feb 10, 2021 · 1 comment · Fixed by #19
Closed

Create filter to turn default youtube embed links into noocookie ones #15

javorszky opened this issue Feb 10, 2021 · 1 comment · Fixed by #19
Assignees

Comments

@javorszky
Copy link
Member

Source: #13 (review)

Turn

https://www.youtube.com/embed/m8iMGFjVgGg

into

https://www.youtube-nocookie.com/embed/m8iMGFjVgGg

Make a filter for it per https://www.11ty.dev/docs/filters/

@omgmog
Copy link
Member

omgmog commented Feb 10, 2021

Also handle these sort of links:

https://www.youtube.com/watch?v=m8iMGFjVgGg

to become:

https://www.youtube-nocookie.com/embed/m8iMGFjVgGg

Also yeah the filter should be straight forward to setup, examples of the ones I've added are here: https://github.com/jsoxford/jsnotoxfordsite/blob/main/.eleventy.js#L29-L43

They are then just used when outputting a value, e.g. you might have a filter called yt and use it like:

{{ stream | yt }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants