From 0ee5005b879ddb6c0aebe9b8303d7c157154407d Mon Sep 17 00:00:00 2001 From: zqlit Date: Wed, 20 May 2026 14:42:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=B8=8BGitHub=20ac?= =?UTF-8?q?tion=20=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/settings.json | 3 +- .github/workflows/deploy.yml | 9 +- GitHubblog.tmp-circles.html | 969 ------------------------ GitHubblog.tmp-links.html | 536 ------------- scripts/generate_notification_report.js | 53 -- 5 files changed, 3 insertions(+), 1567 deletions(-) delete mode 100644 GitHubblog.tmp-circles.html delete mode 100644 GitHubblog.tmp-links.html diff --git a/.claude/settings.json b/.claude/settings.json index 26effad4..84e38953 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -23,7 +23,8 @@ "Bash(curl -s http://127.0.0.1:1316/ -o \".tmp-index.html\")", "Bash(curl -s \"http://127.0.0.1:1316/js/bundle.min.ca22314448750e3cd87573167443c4f61447dd8c77fdb2a8ecf962e6e770a7b7.js\" -o \".tmp-bundle.js\")", "Bash([ ! -x \"$CHROME\" ])", - "Bash(powershell -c \"\\(Get-Command chrome.exe\\).Source\")" + "Bash(powershell -c \"\\(Get-Command chrome.exe\\).Source\")", + "Bash(node scripts/generate_notification_report.js)" ], "additionalDirectories": [ "E:\\GitHub\\Another-Blog" diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e893d603..94ac0a07 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -34,10 +34,7 @@ jobs: - name: Run Pre-Build Scripts shell: pwsh run: | - # 1. 自动生成友链 JSON (即使本地漏提交也能保证是最新的) - ./scripts/update_link_lite_json.ps1 - - # 2. 自动处理隐藏文章 (防止 status: hidden 的文章意外泄露) + # 自动处理隐藏文章 (防止 status: hidden 的文章意外泄露) ./scripts/add_draft_to_hidden.ps1 - name: Setup Node @@ -76,10 +73,6 @@ jobs: fi - - name: Generate Friend Circle Data - continue-on-error: true - run: node scripts/generate_circle_data.js - - name: Check Link Status continue-on-error: true run: node scripts/check_links.js diff --git a/GitHubblog.tmp-circles.html b/GitHubblog.tmp-circles.html deleted file mode 100644 index 710ba009..00000000 --- a/GitHubblog.tmp-circles.html +++ /dev/null @@ -1,969 +0,0 @@ - - - - - - - 友圈 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
-
- 优世界 -
- 点击头像切换昼夜 -
-
-
-
- - - - - - - - - -
-
不以物喜,不以己悲
-
-
- -
- - - -
- -
-
- -
-
-
-

正在探索朋友们的新动态...

-
-
-
- - - -
-
-
-
- - -
- -
- - - -
-
-
- - - - - - - - - - - - -
- - -
-
-
-

搜索文章

- × -
-
-
- - -
-
- -

输入关键词并回车进行搜索

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/GitHubblog.tmp-links.html b/GitHubblog.tmp-links.html deleted file mode 100644 index 4f513022..00000000 --- a/GitHubblog.tmp-links.html +++ /dev/null @@ -1,536 +0,0 @@ - - - - - - - 友链 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
-
-
- 优世界 -
- 点击头像切换昼夜 -
-
-
-
- - - - - - - - - -
-
不以物喜,不以己悲
-
-
- -
- - - -
- -
- -
- -
- - -
- -
- - - -
-
-
- - - - - - - - - - - - -
- - -
-
-
-

搜索文章

- × -
-
-
- - -
-
- -

输入关键词并回车进行搜索

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/scripts/generate_notification_report.js b/scripts/generate_notification_report.js index 9e083efc..11d51b33 100644 --- a/scripts/generate_notification_report.js +++ b/scripts/generate_notification_report.js @@ -3,7 +3,6 @@ const path = require('path'); const matter = require('gray-matter'); const axios = require('axios'); -const FRIEND_CIRCLE_PATH = path.join(__dirname, '../themes/Ying/static/json/friend_circle_data.json'); const LINK_SUMMARY_PATH = path.join(__dirname, '../failed_links_summary.txt'); const POSTS_DIR = path.join(__dirname, '../content/post'); const HUGO_CONFIG_PATH = path.join(__dirname, '../hugo.toml'); @@ -341,58 +340,6 @@ async function main() { console.error("Error reading link summary:", e); } - try { - if (fs.existsSync(FRIEND_CIRCLE_PATH)) { - const data = JSON.parse(fs.readFileSync(FRIEND_CIRCLE_PATH, 'utf8')); - const sevenDaysAgo = new Date(); - sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7); - - const allPostsSorted = (data.posts || []) - .map(p => { - const dt = parseDateFlexible(p && p.date); - return Object.assign({}, p, { __date: dt }); - }) - .filter(p => p.__date instanceof Date && !Number.isNaN(p.__date.getTime())) - .sort((a, b) => b.__date.getTime() - a.__date.getTime()); - - const recentPosts = allPostsSorted.filter(post => post.__date > sevenDaysAgo); - - const authorSet = new Set(recentPosts.map(p => p.author).filter(Boolean)); - - report += `### 👥 朋友圈近况 (近7天)\n`; - const circleMeta = getFileMetaString(FRIEND_CIRCLE_PATH); - if (circleMeta) report += `- 数据: ${circleMeta}\n`; - report += `- 更新: ${recentPosts.length} 条, 活跃作者: ${authorSet.size}\n`; - const toShow = recentPosts.length > 0 ? recentPosts : allPostsSorted; - if (toShow.length === 0) { - report += `无更新\n`; - report += `\n`; - } else { - if (recentPosts.length === 0) { - report += `- 近7天无更新,展示最近10条:\n`; - } - const limitedPosts = toShow.slice(0, 10); - limitedPosts.forEach(post => { - const dateStr = formatDateMDY(post.__date); - const author = post.author || '未知作者'; - const link = post.link || post.url || ''; - const blogUrl = post.blogUrl ? ` ${post.blogUrl}` : ''; - if (link) { - report += `- [${author}] \`${link}\` (${dateStr})${blogUrl}\n`; - } else { - report += `- [${author}] (${dateStr})${blogUrl}\n`; - } - }); - if (toShow.length > 10) { - report += `... 以及其他 ${toShow.length - 10} 篇\n`; - } - report += `\n`; - } - } - } catch (e) { - console.error("Error reading friend circle data:", e); - } - report += `### 🧩 环境\n`; report += `- Node: ${process.version}\n`; if (process.env.RUNNER_OS) report += `- Runner: ${process.env.RUNNER_OS}\n`;