diff options
Diffstat (limited to 'src/content/dependencies/linkTemplate.js')
-rw-r--r-- | src/content/dependencies/linkTemplate.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/content/dependencies/linkTemplate.js b/src/content/dependencies/linkTemplate.js index b87f3180..9109ab50 100644 --- a/src/content/dependencies/linkTemplate.js +++ b/src/content/dependencies/linkTemplate.js @@ -22,6 +22,7 @@ export default { path: {validate: v => v.validateArrayItems(v.isString)}, hash: {type: 'string'}, + tooltip: {validate: v => v.isString}, attributes: {validate: v => v.isAttributes}, color: {validate: v => v.isColor}, content: {type: 'html'}, @@ -30,6 +31,7 @@ export default { content(slots) { let href = slots.href; let style; + let title; if (!href && !empty(slots.path)) { href = to(...slots.path); @@ -53,11 +55,16 @@ export default { style = `--primary-color: ${primary}; --dim-color: ${dim}`; } + if (slots.tooltip) { + title = slots.tooltip; + } + return html.tag('a', { ...slots.attributes ?? {}, href, style, + title, }, slots.content); }, |