feat(rss): 添加RSS订阅功能并优化日期处理

- 在DEPLOYMENT.md中添加RSS_FEED_URL环境变量配置说明
- 修改日期处理函数,统一使用GMT时区格式
- 实现RSS订阅功能,支持通过Feedly等阅读器订阅
- 优化GitHub API调用的Base64编解码处理
- 更新README展示RSS订阅链接和访问方式
This commit is contained in:
justlovemaki
2025-06-15 14:34:24 +08:00
parent 1841248fec
commit 3c6740528e
9 changed files with 81 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
// src/handlers/commitToGitHub.js
import { getISODate, formatMarkdownText, replaceImageProxy,formatDateToChineseWithTime } from '../helpers.js';
import { getISODate, formatMarkdownText, replaceImageProxy,formatDateToGMT0WithTime, sleep } from '../helpers.js';
import { getGitHubFileSha, createOrUpdateGitHubFile } from '../github.js';
import { storeInKV } from '../kv.js';
import { marked } from '../marked.esm.js';
@@ -19,7 +19,7 @@ export async function handleCommitToGitHub(request, env) {
link: '/daily/'+dateStr+'.html',
content_html: null,
// 可以添加其他相關欄位,例如作者、來源等
published_date: formatDateToChineseWithTime(new Date()) // 記錄保存時間
published_date: formatDateToGMT0WithTime(new Date()) // 記錄保存時間
}
const filesToCommit = [];