[hp34970] replace dailymotion by peertube for embedded video

Tue, 28 Aug 2018 15:07:01 +0200

author
David Douard <david.douard@logilab.fr>
date
Tue, 28 Aug 2018 15:07:01 +0200
changeset 108
08c0c0d695e8
parent 104
8396e709bde5
child 109
96e9f64b86ed

[hp34970] replace dailymotion by peertube for embedded video

content/hp34970a_4.rst file | annotate | diff | comparison | revisions
pelicanconf.py file | annotate | diff | comparison | revisions
theme/static/css/peertube.css file | annotate | diff | comparison | revisions
theme/templates/base.html file | annotate | diff | comparison | revisions
--- a/content/hp34970a_4.rst	Tue Aug 28 15:05:01 2018 +0200
+++ b/content/hp34970a_4.rst	Tue Aug 28 15:07:01 2018 +0200
@@ -133,9 +133,7 @@
 dedicated thread, and bingo, I've got now something that begins to
 work enough to make it usable:
 
-.. dailymotion:: x4tib5s
-   :width: 270
-   :height: 480
+.. peertube:: 2be141c0-64ca-446a-ac65-15014604fb37
 
 
 What's next
--- a/pelicanconf.py	Tue Aug 28 15:05:01 2018 +0200
+++ b/pelicanconf.py	Tue Aug 28 15:07:01 2018 +0200
@@ -69,7 +69,7 @@
 STATIC_PATHS = ['images', 'pdfs', 'json']
 
 PLUGIN_PATHS = ['pelican-plugins',
-                'pelican-plugins/pelican_dailymotion',
+                'pelican-plugins/pelican-peertube',
                 ]
 PLUGINS = ['better_figures_and_images',
            'sitemap',
@@ -78,7 +78,7 @@
            'series',
            'related_posts',
            'filetime_from_hg',
-           'pelican_dailymotion',
+           'pelican_peertube',
            'pelican_javascript',
            'wavedrom',
            'plotly',
@@ -108,3 +108,6 @@
                   'default': '800w',
                   },
   }
+
+PEERTUBE_URL = "https://peertube.social"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/theme/static/css/peertube.css	Tue Aug 28 15:07:01 2018 +0200
@@ -0,0 +1,37 @@
+*
+ * Responsive design style sheet for pelican PeerTube integration.
+ * Makes the video as wide as possible, keeping a specified aspect ratio
+ * of the video (e.g. 4:3, 16:9, etc. for width vs height).  The video
+ * will resize and shrink as you resize the browser window.  Enjoy!
+ *
+ * Integrate these definitions into your project style sheet, and use as
+ *
+ * <div class="peertube peertube-16x9">
+ *     <iframe src="https://your.peertube.instance/embed/VIDEO_ID" allowfullscreen seamless frameborder="0"></iframe>
+ * </div>
+ *
+ * (c) 2018 David Douard <david.douard@sdfa3.org>, license: MIT
+ */
+
+.peertube-4x3 {
+	padding-bottom: 75%;  /* inverse of 4:3 aspect ratio */
+}
+.peertube-16x9 {
+	padding-bottom: 56.25%;  /* inverse of 16:9 aspect ratio */
+}
+.peertube-4x3,
+.peertube-16x9 {
+	position: relative;
+	height: 0;
+	overflow: hidden;
+}
+.peertube-4x3 iframe,
+.peertube-16x9 iframe {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 100%;
+	height: 100%;
+	margin: 0;
+	border: 0;
+}
--- a/theme/templates/base.html	Tue Aug 28 15:05:01 2018 +0200
+++ b/theme/templates/base.html	Tue Aug 28 15:07:01 2018 +0200
@@ -7,6 +7,7 @@
   <script type="text/javascript" src="{{ SITEURL }}/theme/js/modernizr.js"></script>
   <link href="{{ SITEURL }}/theme/css/exo2.css" rel='stylesheet' type='text/css'>
   <link rel="stylesheet" href="{{ SITEURL }}/theme/css/lamboz.css" media="all">
+  <link rel="stylesheet" href="{{ SITEURL }}/theme/css/peertube.css" media="all">
   {% block head %}
   <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
   <meta charset="utf-8" />

mercurial