Skip to content

Commit

Permalink
Version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenpeters1986 committed Feb 17, 2021
1 parent e9a975f commit d638a48
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 15 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
djangocms-youtube-lazyload
==========================

![PyPI](https://img.shields.io/pypi/v/djangocms-youtube-lazyload)
![PyPI - Status](https://img.shields.io/pypi/status/djangocms-youtube-lazyload)
![PyPI - Django Version](https://img.shields.io/pypi/djversions/djangocms-youtube-lazyload)
![PyPI - License](https://img.shields.io/pypi/l/djangocms-youtube-lazyload)
![PyPI - Downloads](https://img.shields.io/pypi/dm/djangocms-youtube-lazyload)

Speed up your pageloads with this YouTube embed plugin for your Django CMS
powered site. It requires a (free) YouTube Data API Key.

Expand All @@ -11,33 +17,32 @@ Quickstart
```
pip install djangocms-youtube-lazyload
```
2. Add `djangocms_youtube_lazyload` to `INSTALLED_APPS`:
1. Add `djangocms_youtube_lazyload` to `INSTALLED_APPS`:
```
INSTALLED_APPS = (
...
'djangocms_youtube_lazyload',
...
)
```

3. Sync database :
1. Sync database :
```
python manage.py migrate
```

4. Plugin requires Server API key to be able to use the YouTube Data
API:
1. Collect static files to make sure you can edit your videos with Django CMS
```
python manage.py collectstatic
```
1. Plugin requires Server API key to be able to use the YouTube Data API
```
DJANGOCMS_YOUTUBE_LAZYLOAD_API_KEY = '<youtube_data_api_server_key>'
```
Instructions on how to obtain an API key are located here:
https://developers.google.com/youtube/registering_an_application

Features
--------

Reduce Page Load Time
---------------------
This Youtube plugin reduces Page Load Time
------------------------------------------

When you embed any YouTube video on your website using standard IFRAME
tags, you’ll be surprised to know how much extra weight that YouTube
Expand Down Expand Up @@ -82,6 +87,7 @@ Full support for schema.org `videoObject` markup.

See https://developers.google.com/webmasters/videosearch/schema


Video Endscreen
---------------

Expand Down
2 changes: 1 addition & 1 deletion djangocms_youtube_lazyload/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0'
__version__ = '1.0.4'
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block extrahead %}
{# in case plugins require widgets, they need to have bundle here #}
<script src='{% static_with_version 'cms/js/dist/bundle.admin.base.min.js' %}" type="text/javascript"></script>
<script src="{% static_with_version 'cms/js/dist/bundle.admin.base.min.js' %}" type="text/javascript"></script>
<script type="text/javascript">
if (!window.jQuery) {
window.jQuery = CMS.$;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@


{% addtoblock 'css' %}
<link rel="stylesheet" href="{% static 'css/djangocms_youtube_lazyload/djangocms_youtube_lazyload.css' %}">
<link rel="stylesheet" href="{% static 'djangocms_youtube_lazyload/djangocms_youtube_lazyload.css' %}">
{% endaddtoblock %}


{% addtoblock 'js' %}
<script src="{% static 'js/djangocms_youtube_lazyload/greensock-js/TweenMax.min.js' %}"></script>
<script src="{% static 'js/djangocms_youtube_lazyload/jquery.yt-player.js' %}"></script>
<script src="{% static 'djangocms_youtube_lazyload/greensock-js/TweenMax.min.js' %}"></script>
<script src="{% static 'djangocms_youtube_lazyload/jquery.yt-player.js' %}"></script>
<script type="text/javascript">
jQuery(function() {
jQuery('.js-video-wrapper').youTubePlayer({hl: '{{ LANGUAGE_CODE|default:"en" }}'});
Expand Down

0 comments on commit d638a48

Please sign in to comment.