日记
2026年7月16日
工具 AI 批量替换路径:Daily/** 下所有日记文件中 frontmatter 里 location 字段内容
// 目标匹配旧地址 & 新地址
const oldLoc = "澜岸铭邸, 衢州市, 中国";
const newLoc = "澜岸铭邸, 衢州市, 浙江省";
// 筛选Daily文件夹下全部md文件
const allDaily = dv.pages('"Daily"');
let modifyCount = 0;
for (let page of allDaily) {
// 仅当前location等于旧地址才处理
if (page.location && page.location === oldLoc) {
const file = app.vault.getFileByPath(page.file.path);
if (!file) continue;
// 读取文件全文
let content = await app.vault.read(file);
// frontmatter location行替换
content = content.replace(`location: ${oldLoc}`, `location: ${newLoc}`);
// 写回文件
await app.vault.modify(file, content);
modifyCount++;
console.log(`已修改: ${file.path}`);
}
}
dv.paragraph(`✅ 批量替换完成,共修改 ${modifyCount} 篇日记`);
投资 平仓[[Daily/2026/2026-06-18|2026-06-18]]的泡泡玛特卖put
