-
Howdy, we use the anchor tracking feature. Our readers have repeatedly requested that we make it so clicking the anchor link icon copies the full URL to the user's clipboard. Is there a quick way to implement this functionality without having to do full-on theme development? |
Beta Was this translation helpful? Give feedback.
Answered by
squidfunk
Aug 29, 2022
Replies: 1 comment 1 reply
-
Sure, add something like this as additional JavaScript (should also work with instant loading): document$.subscribe(() => {
const links = Array.from(document.querySelectorAll(".headerlink"))
for (const link of links) {
link.setAttribute("data-clipboard-text", link.href)
}
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
caseyamp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure, add something like this as additional JavaScript (should also work with instant loading):