From 428365b0eff963c38179c360c8e01d46832a68d9 Mon Sep 17 00:00:00 2001 From: William Hennessy Date: Sat, 27 Jun 2020 07:44:05 -0500 Subject: [PATCH] files added --- README.md | 89 ++++++++++++++++++++++++++++++++++- layouts/shortcodes/audio.html | 4 ++ layouts/shortcodes/video.html | 2 + 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 layouts/shortcodes/audio.html create mode 100644 layouts/shortcodes/video.html diff --git a/README.md b/README.md index b2c2268..62bf74f 100644 --- a/README.md +++ b/README.md @@ -1 +1,88 @@ -# hugo-shortcodes +# Hugo Shortcodes + +Simple shortcodes for Hugo. + +* Audio: Implements the HTML audio tag +* Video: Implements the HTML video tag to run self-hosted videos. + +## Getting Started + +Just copy these shortcodes into your shortcodes directory: + +``` +path-to-hugo-repo/layouts/shortcodes/ +``` + +### Prerequisites + +Assumes you have a local Hugo repo. + +### Installing + +Clone this repo: + +``` +git clone https://github.com/billhennessy/hugo-shortcodes.git +``` + +Copy the shortcodes to your local repo: + +``` +cp ~/path-to-shortcodes-repo/layouts/shortcodes/*.html ~/path-to-hugo-repo/layouts/shortcodes +``` + +Your local Hugo repo should now contain `video.html` and `audio.html` + +## Usage + +### audio.html + +Audio requires two arguments: + +* path-to-audio with quotes `audio/my-voice-recording.mp3` +* preload (auto | metadata | none) + +Example: + +``` +{{< audio "/audio/my-voice-recording.mp3" auto >}} + +``` + +Note: I use only `auto` to prevent skipping in Chrome browser. + +The HTML audio tag works with `.mp3`, `.ogg`, and `.wav` files only. + +### video.html + +IN DEVELOPMENT + + + +## Deployment + +Just follow your usual deployment method. + +## Built With + +* HTML audio and video tags + + +## Contributing + +Just submit a pull request. + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/billhennessy/hugo-shortcodes/tags). + +## Authors + +* **Bill Hennessy** - Sales Engineer and developer + +## License + +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details + + + diff --git a/layouts/shortcodes/audio.html b/layouts/shortcodes/audio.html new file mode 100644 index 0000000..92d0941 --- /dev/null +++ b/layouts/shortcodes/audio.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 0000000..6a0402f --- /dev/null +++ b/layouts/shortcodes/video.html @@ -0,0 +1,2 @@ + + \ No newline at end of file