From 816caaae5b3b85dee674fc4d39534708ec8fd4a2 Mon Sep 17 00:00:00 2001 From: chicrobot Date: Fri, 21 Nov 2025 01:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=9A=E5=AE=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 6 +++--- script.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 5c92896..21d1ad8 100644 --- a/index.html +++ b/index.html @@ -226,7 +226,7 @@

最新思路

-
+

赛博朋克时代的前端架构思考

@@ -235,7 +235,7 @@ 继续阅读
-
+

从0到1搭建个人技术栈

@@ -244,7 +244,7 @@ 继续阅读
-
+

未来界面:玻璃拟态与全息效果

diff --git a/script.js b/script.js index 5f3f2b2..3cbf4d2 100644 --- a/script.js +++ b/script.js @@ -53,6 +53,9 @@ window.addEventListener('load', function() { const jenkinsUrl = `${window.location.protocol}//${currentHost}:9095`; const chatUrl = `${window.location.protocol}//${currentHost}/baseTalk`; const cloudreveUrl = `${window.location.protocol}//${currentHost}:5212`; + // 构建博客文章URL,指向8090端口 + const blogBaseUrl = `${window.location.protocol}//${currentHost}:8090`; + // 设置链接的href属性和target属性,确保在新标签中打开 const portainerLink = document.getElementById('portainerLink'); const giteaLink = document.getElementById('giteaLink'); @@ -60,6 +63,7 @@ window.addEventListener('load', function() { const jenkinsLink = document.getElementById('jenkinsLink'); const chatLink = document.getElementById('chatLink'); const cloudreveLink = document.getElementById('cloudreveLink'); + if (portainerLink) { portainerLink.href = portainerUrl; portainerLink.target = '_blank'; @@ -84,6 +88,20 @@ window.addEventListener('load', function() { cloudreveLink.href = cloudreveUrl; cloudreveLink.target = '_blank'; } + + // 处理博客文章链接 + const blogPosts = document.querySelectorAll('.thought-card'); + blogPosts.forEach((post, index) => { + // 移除原有的onclick属性 + post.removeAttribute('onclick'); + // 添加新的点击事件监听器 + post.addEventListener('click', function() { + // const postPath = `/blog/post${index + 1}`; + // const postUrl = `${blogBaseUrl}${postPath}`; + const postUrl = `${blogBaseUrl}`; + window.open(postUrl, '_blank'); + }); + }); }); // 粒子背景效果