-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da5fe78
commit 428365b
Showing
3 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<audio controls preload="{{ index .Params 1 }}"> | ||
<source src="{{ index .Params 0 }}" type="audio/mpeg"> | ||
Your browser does not support the audio element. | ||
</audio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!-- IN DEVELOPMENT --> | ||
|