Pelican YouTube is a Pelican plugin, which allows you to embed YouTube videos in your pages and articles.
Installation
Pip
You can install pelican-youtube from PyPI as usual, e.g.
pip install pelican-youtube
Pelican 4.5+ will detect the newly installed plugin automatically.
See the Pelican documentation on plugins if you use an older version or you want to manually integrate the plugin in your pelicanconf.py.
Local plugins directory
$ mkdir plugins
$ cd plugins
$ git clone https://github.com/kura/pelican_youtube.git
Then enable it in your pelicanconf.py, e.g.
PLUGIN_PATHS = ["plugins/"]
PLUGINS = [
# ...
"pelican_youtube",
# ...
]
Usage
In your article or page, you simply need to add a line to embed your video.
.. youtube:: VIDEO_ID
Which will result in:
<div class="youtube youtube-16x9">
<iframe src="https://www.youtube.com/embed/VIDEO_ID" allowfullscreen seamless frameBorder="0"></iframe>
</div>
Additional arguments
Attribute |
default |
|
|---|---|---|
allowfullscreen |
yes |
allow video to be displayed full-screen |
seamless |
yes |
no borders around iframe |
class |
youtube-16x9 |
additional CSS classes, usually for responsive behavior |
empty° |
(° when width or height are specified) |
|
width, height |
empty |
video dimensions when responsive design is not desired |
Example 1: (responsive design)
.. youtube:: 4_X6EyqXa2s
:class: youtube-4x3
:allowfullscreen: no
:seamless: no
Will result in:
<div class="youtube youtube-4x3">
<iframe src="https://www.youtube.com/embed/4_X6EyqXa2s"></iframe>
</div>
Example 2: (non-responsive design)
.. youtube:: 4_X6EyqXa2s
:width: 800
:height: 500
:allowfullscreen: no
Will result in:
<div class="youtube">
<iframe width="800" height="500" src="https://www.youtube.com/embed/4_X6EyqXa2s" seamless frameBorder="0"></iframe>
</div>
More Control of YouTube Video Player
YouTube offers more control via player parameters, which you simply attach to the VIDEO_ID as query parameters. See YouTube documentation for a list of possible parameters.
Example: (start video at time 00:20, start playing automatically, don’t show related content at end of video)
.. youtube:: 4_X6EyqXa2s?start=20&autoplay=1&rel=0
Known Issues
The presence of the frameBorder attribute causes an HTML5 validation error. Unfortunately, this attribute is still necessary for supporting older versions of Internet Explorer.
License
MIT license.
Metadata
Release files for pelican-youtube 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pelican_youtube-0.3.0.tar.gz | 4.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pelican_youtube-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / pelican_youtube-0.3.0.tar.gz
| Download URL | pelican_youtube-0.3.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
156bd43771b87115ab8085210c3db95f1ead0daa60bd485baa5f4e997aa31f63
|
|
BLAKE2b-256 checksum How to use checksums |
bf6a860e28d55c4135c1080f14b40cceb2a1626deb40d5cdfc8fd69f4073045f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / pelican_youtube-0.3.0-py3-none-any.whl
| Download URL | pelican_youtube-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eefa374bd0531baf7fd8e2756769259daa01750b57c679de4ea689ba8cf0750b
|
|
BLAKE2b-256 checksum How to use checksums |
57b73db9e6956e22ae17a03e7e9d0069a3c503b07dc738301b617e6402ae18c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Security for pelican-youtube 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.