Skip to content

About

A video link pasted on its own line becomes a player.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Video

A Kite plugin: a video link pasted on a line of its own becomes a player.

https://cdn.example.com/2026/demo.mp4

becomes a <video> with controls, and

https://www.bilibili.com/video/BV1xx411c7mD
https://youtu.be/dQw4w9WgXcQ

become the players those sites serve. Nothing else changes: a link inside a sentence stays a link, and a link inside a code block is left exactly as written.

What it recognises

Address Becomes
…/demo.mp4, …/demo.webm, …/demo.ogg a <video> element
bilibili.com/video/BV…, b23.tv/… Bilibili's player, loading="lazy"
youtube.com/watch?v=…, youtu.be/… YouTube's player, on youtube-nocookie.com, loading="lazy"

The same addresses pasted as a picture, ![](https://…/demo.mp4), are taken too: a picture of a video is a broken image otherwise.

Both forms are only taken when they stand alone in a paragraph.

Why a plugin, and not the video shortcode

The shortcode needs a template in the site or its theme; a site without one stops the build at that line. This plugin rewrites the finished HTML instead, so it works with any theme and needs no markdown.unsafeHTML.

The shortcode is still the better choice when the theme has layouts/_shortcodes/video.html: it takes poster and caption, which a pasted address has nowhere to carry. The two can live side by side.

Build

make          # plugin.wasm, built with GOOS=wasip1 GOARCH=wasm
make test     # the transform, on the host

Needs Go 1.27.4 or newer, the same floor as Kite itself: the module is built with the patched toolchain, and //go:wasmexport needs 1.24 or newer.

Use

In a site:

mkdir -p plugins && cp -r ../kite-plugin-video plugins/video

then in kite.yaml:

plugins:
  enabled: [video]

kite plugin verify plugins/video checks it the way a build does.

Limits

A plugin cannot upload a file or raise Kite's 32 MB upload limit. A video too large for the repository belongs on a CDN or an object storage bucket, with the address pasted into the post; that is what this plugin is for.

About

A video link pasted on its own line becomes a player.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages