--- tags: - home - 导航页 aliases: - 导航 - home 日期: 2026/4/16 --- ## 准备将这个页面作为导航页,还没想好怎么做 ```dataviewjs // 1. 获取全库页面 (排除附件和模板,避免干扰) const pages = dv.pages('!"Template" and !"Attachments"'); // 2. 统计每天的数据 const activityMap = new Map(); pages.forEach(p => { // 获取创建日期和修改日期 const dates = [ window.moment(p.file.cday.ts).format("YYYY-MM-DD"), window.moment(p.file.mday.ts).format("YYYY-MM-DD") ]; // 获取权重:使用文件大小 (Bytes),这是反映“活跃度”最稳健的指标 const weight = p.file.size || 0; // 对创建和修改日期都进行打点 dates.forEach(d => { activityMap.set(d, (activityMap.get(d) || 0) + weight); }); }); // 3. 转换为渲染条目 const entries = []; for (let [date, value] of activityMap) { entries.push({ date: date, intensity: value, content: "" // 关键修改:设为空,彻底去除格子上的文字 }); } // 4. 渲染 renderHeatmapTracker(this.container, { year: 2026, entries: entries, colors: "green", showValue: true, // 鼠标悬停时依然能看到数值,但格子表面是干净的 // 根据你的库大小,调整颜色深浅的阈值(单位:字节) intensity: [ { min: 1, color: "#9be9a8" }, // 有轻微改动 { min: 100, color: "#40c463" }, // 中度活跃 { min: 1000, color: "#30a14e" }, // 深度编辑 { min: 5000, color: "#216e39" } // 爆更状态 ] }); ```