| | |
| | | {{if $.Site.Data.config.enableLinkPreview}} |
| | | <script> |
| | | async function run() { |
| | | const {content} = await fetchData() |
| | | function htmlToElement(html) { |
| | | const template = document.createElement('template') |
| | | html = html.trim() |
| | |
| | | document.addEventListener("DOMContentLoaded", () => { |
| | | [...document.getElementsByClassName("internal-link")] |
| | | .forEach(li => { |
| | | console.log(li.dataset.src.replace(pathRegex, '')) |
| | | const linkDest = content[li.dataset.src.replace(pathRegex, '')] |
| | | if (linkDest) { |
| | | const popoverElement = `<div class="popover"> |
| | |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | run() |
| | | </script> |
| | | {{end}} |