From 7c2d7831d8170b5cf8e2dcb8e836cfbe9532f44b Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Tue, 4 Aug 2026 20:28:14 +0200 Subject: [PATCH] Add video plugin --- _source/_includes/head.html | 4 + _source/_plugins/video_embed/video_embed.rb | 93 +++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 _source/_plugins/video_embed/video_embed.rb diff --git a/_source/_includes/head.html b/_source/_includes/head.html index 05df80c..fc2eed4 100644 --- a/_source/_includes/head.html +++ b/_source/_includes/head.html @@ -4,6 +4,10 @@ {%- seo -%} + {%- if page.video -%} + + + {%- endif -%} {%- feed_meta -%} {%- if jekyll.environment == 'production' and site.google_analytics -%} {%- include google-analytics.html -%} diff --git a/_source/_plugins/video_embed/video_embed.rb b/_source/_plugins/video_embed/video_embed.rb new file mode 100644 index 0000000..752612b --- /dev/null +++ b/_source/_plugins/video_embed/video_embed.rb @@ -0,0 +1,93 @@ +# Liquid tag for embedding video.js players from assets, mirroring how images +# are embedded via plain relative paths (see _includes/head.html's tag). +# +# Syntax: +# {% video urls [class names] [width height] [preload:auto|metadata|none] %} +# +# `urls` is a comma-separated list of one or more relative asset paths, used +# as elements (multiple formats/resolutions). Everything after that +# is free-form, order-independent tokens classified by shape: +# - preload:auto|metadata|none -> preload attribute +# - a bare integer -> width, then height +# - anything else -> appended to the CSS class list +# +# The rendered markup is a plain HTML5