diff --git a/docs/assets/plugins/links/links.js b/docs/assets/plugins/links/links.js new file mode 100644 index 00000000..874ddbdc --- /dev/null +++ b/docs/assets/plugins/links/links.js @@ -0,0 +1,19 @@ +(() => { + if (!window.$docsify) { + throw new Error('Docsify must be loaded before installing this plugin.'); + } + + window.$docsify.plugins.push((hook, vm) => { + hook.mounted(function () { + + document.addEventListener('click', event => { + const tag = event.target.tagName.toLowerCase(); + const href = event.target.getAttribute('data-href'); + + if (tag === 'sl-button' && href) { + window.open(href); + } + }); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index 62d2f01c..ae1f0154 100644 --- a/docs/index.html +++ b/docs/index.html @@ -93,5 +93,6 @@ +