We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01b18ce commit e989c4eCopy full SHA for e989c4e
1 file changed
scripts/generate-docs-rss.js
@@ -273,7 +273,16 @@ async function generateDocsRSS() {
273
}
274
275
// 按更新时间排序并截取最大数量
276
- const sortedDocs = docsData.sort((a, b) => b.lastUpdatedAt - a.lastUpdatedAt);
+ // 时间相同时按文件路径排序,确保跨平台一致性
277
+ const sortedDocs = docsData.sort((a, b) => {
278
+ // 主要排序:按更新时间降序
279
+ const timeDiff = b.lastUpdatedAt - a.lastUpdatedAt;
280
+ if (timeDiff !== 0) {
281
+ return timeDiff;
282
+ }
283
+ // 次要排序:按文件路径升序
284
+ return a.file.localeCompare(b.file);
285
+ });
286
const limitedDocs = sortedDocs.slice(0, SITE_CONFIG.maxItems);
287
288
// 添加RSS条目
0 commit comments