Shortcodes are among my favorite features in Hugo. As I am currently writing several notes a week that often include small screencasts, I thought that the time had come for me to create my own screencast shortcode. Here it is:
|
|
In this shortcode I have named the two arguments available:
src
that has no default value;width
that is set to100%
is no value is passed.
Also, I only use .webm file as it is an open video format for the web (and the default format of screencast in GNOME). From now on, I include my screencast like so:
|
|
and if I want to modify the width, I simply do:
|
|
Quite convenient, isn’t it?
A last sentence to mention that I am actually using several shortcodes for this website (including one that parses a list of authors) if you are interested, have a look at the GitHub repository.