Embed media files from archive.org
Include audio and video files hosted on Archive.org with Hugo Shortcodes
Table of content
Embed a single audio file
Usage:
{{< audio "https://archive.org/download/foo/bar.mp3" >}}
Demo:
Main features
- supports WAV, FLAC, OGG, MP3, M4A
- based on standard HTML element
- does not require Javascript
- supports remote audio files
- provides a download link
- nice UI, lightweight: 180 Ko
- keyboard navigation
Caveats
- allows to embed only a single file at a time. See below for a solution
Embed multiple audio files
Embed all audio files from a folder hosted on Archive.org
Usage:
{{< archive-audio "https://archive.org/details/heyamoli" >}}
Demo:
-
Heyamoli - Voix basse partie 1 - version ATC 2022
-
Heyamoli - Voix medium partie 1 - version ATC 2022
-
Heyamoli - en petit comité puis tout le monde - version ATC 2022
-
Heyamoli - transmission complete - version ATC 2022
-
Heyamoli - version Tutarchela
Details
Main features
- based on standard HTML element
- supports WAV, FLAC, OGG, MP3, M4A
- does not require Javascript
- supports remote audio files
- provides a download link
- nice UI, lightweight: 140 Ko
- keyboard navigation
- allows to embed multiple audio files
References
- Documentation
- Source code: Github - Gitlab
- Issue tracker
Resources
- Data can also be retrieved from local JSON/XML files
- Hugo Documentation about data templates
- Guide: How to create a Shortcode
- Guide: How to handle
cache – See the build option
--ignoreCache
Embed a video file
Demo:
Usage:
{{< video "https://archive.org/download/foo/bar.mp4" >}}
Options:
{{< video src="foo.mp4" caption="A custom description" poster="preview-image.jpg" class="foo" preload="none" >}}
Details
Main features
- based on standard HTML element
- does not require Javascript
- supports remote video files
- provides a download link
- nice UI, lightweight: 180 Ko
- keyboard navigation
References
- Documentation
- Source code: Github - Gitlab
- Issue tracker