Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Jekyll plugin to generate html5 snippets for embedding YouTube videos, without iframes.

License

NotificationsYou must be signed in to change notification settings

LorenzoSapora/jekyll-html5-youtube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gem Version

Jekyll plugin to generate clean html5 snippets for embedding YouTube videos, without iframes.

Canonical source

The canonical source of Jekyll HTML5 Youtube is hosted onhttps://git.knowbl.co/dev/jekyll-html5-youtube/.

Table of contents

Installation

gem install jekyll-html5-youtube

and put this at the bottom of thegems: section, in your_config.yml

gems:  -jekyll-html5-youtube

add this to your CSS file

.embed-container{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;max-width:100%}.embed-containerobject{position:absolute;top:0;left:0;width:100%;height:100%}

Usage

{% youtube "https://www.youtube.com/watch?v=abcd5678" %}

You can also use

# Playlists{% youtube "https://www.youtube.com/embed/abcd5678?list=abcd5678" %}# Share/embeds{% youtube "https://www.youtube.com/embed/abcd5678" %}# Short URLs{% youtube "https://youtu.be/abcd5678" %}

Result

By default the plugin will output

<divclass="embed-container"><objectdata="https://www.youtube.com/embed/abcd5678"></object></div>

You can write your own snippet by creating a file in_includes calledyoutube.html. The YouTube ID is displayed using{{ youtube_id }}.

Exampleyoutube.html:

<objectdata="https://www.youtube.com/embed/{{ youtube_id }}"style="width:100%;height:100vh"></object>

Examples

For troubleshooting, or just a quick start usingjekyll-html5-youtube, you can look inside theexamples folder.

examples/default is using the default output.

examples/custom is a custom output for the partial, using_includes/youtube.html.

TODO

  • Add examples.
  • Support for timecode feature.
  • Support for playlists.
  • Support for channel information display.
  • Bug hunt.

Feedback/Contributing

Any direct feedback can be given here:

https://knowbl.co/contact/

Or raise an issue

https://github.com/knowbl/jekyll-html5-youtube/issues

AUTHOR

Written byLorenzo Sapora forKnowbl.

About

Jekyll plugin to generate html5 snippets for embedding YouTube videos, without iframes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp