diff --git a/page.rst b/page.rst new file mode 100644 index 0000000..7ddb1e2 --- /dev/null +++ b/page.rst @@ -0,0 +1,31 @@ +TEST PAGE +============ +:date: 2019-12-08 19:00 +:modified: 2019-12-08 19:00 +:category: Ramblings + +This is a test page to test different plugins + +List: +* Item +* Item +* Item + ++------------+------------+-----------+ +| Header 1 | Header 2 | Header 3 | ++============+============+===========+ +| body row 1 | column 2 | column 3 | ++------------+------------+-----------+ +| body row 2 | Cells may span columns.| ++------------+------------+-----------+ +| body row 3 | Cells may | - Cells | ++------------+ span rows. | - contain | +| body row 4 | | - blocks. | ++------------+------------+-----------+ + + +.. peertube:: peertube.social 13fde89f-5360-4020-8ea4-93eda2665b54 + :width: 240 + :height: 224 + :loop: True + diff --git a/pelican_peertube/peertube.py b/pelican_peertube/peertube.py index 5b7b19d..a1df621 100644 --- a/pelican_peertube/peertube.py +++ b/pelican_peertube/peertube.py @@ -47,8 +47,8 @@ class PeerTube(Directive): url = f"https://{instanceURL}/videos/embed/{videoID}?" - width = self.options["width"] if "width" in self.options else "560" - height = self.options["height"] if "height" in self.options else "315" + width = self.options["width"] if "width" in self.options else 560 + height = self.options["height"] if "height" in self.options else 315 fullscreen = ( self.options["fullscreen"] if "fullscreen" in self.options else True ) @@ -57,36 +57,36 @@ class PeerTube(Directive): muted = self.options["muted"] if "muted" in self.options else False loop = self.options["loop"] if "loop" in self.options else False title_show = ( - self.options["title_show"] if "title_show" in self.options else True + self.options["title_show"] if "title_show" in self.options else "" ) privacy_show = ( - self.options["privacy_show"] if "privacy_show" in self.options else True + self.options["privacy_show"] if "privacy_show" in self.options else "" ) controls_show = ( - self.options["controls_show"] if "controls_show" in self.options else True + self.options["controls_show"] if "controls_show" in self.options else "" ) iframe_arguments = [ - (width, "width='{}'"), - (height, "height='{}'"), + (width, "width={}"), + (height, "height={}"), (fullscreen, "allowfullscreen"), (seamless, "frameborder='0'"), ] url_arguments = [ - (autoplay, "autoplay='{}'"), - (muted, "muted='{}'"), - (loop, "loop='{}'"), - (title_show, "title='{}'"), - (privacy_show, "warningTitle='{}'"), - (controls_show, "controls='{}'"), + (autoplay, "autoplay={}"), + (muted, "muted={}"), + (loop, "loop={}"), + (title_show, "title={}"), + (privacy_show, "warningTitle={}"), + (controls_show, "controls={}"), ] for value, format in url_arguments: toggle = 1 if value == True else 0 - url += (format).format(toggle) if value else "" - - embed_block = f"