From 2c9b7561072ea4f16267164952f06d1a8a5ca84b Mon Sep 17 00:00:00 2001 From: glossimute Date: Mon, 19 May 2025 12:43:53 +0900 Subject: [PATCH] Update post.html --- templates/post.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/post.html b/templates/post.html index 6f81c04..cc7a9d0 100644 --- a/templates/post.html +++ b/templates/post.html @@ -73,6 +73,11 @@ + {% endblock %} {% block content %} @@ -95,7 +100,14 @@ document.getElementById("pathHome").setAttribute("d",IconList["home"]); span.innerHTML="{{ blogBase['commentNum'] }}"; cmButton.appendChild(span); {%- endif %} - +document.getElementById("copyLinkBtn").addEventListener("click", () => { + const url = window.location.href; + navigator.clipboard.writeText(url).then(() => { + alert("文章链接已复制!"); + }).catch(() => { + alert("复制失败,请手动复制链接"); + }); +}); {% if blogBase['needComment']==1 %} function openComments(){ cm=document.getElementById("comments");