Implementing a similiar Wordpress Shortcode feature in Javascript using Template Strings.
"In a nutshell, a shortcode is a small piece of code, indicated by brackets like
[this]
, that performs a dedicated function on your site."
In Javascript when can implement Shortcodes using Template Strings.
Pretend that we have a template page-template.html
that contains a shortcode gallery
which will be replaced by the code of AwesomeGallery
.