This commit is contained in:
luke 2025-06-20 01:32:24 +08:00
parent e6de46809f
commit 89c229fd28

View File

@ -177,10 +177,10 @@ document.addEventListener("DOMContentLoaded", async () => {
results.forEach(doc => { results.forEach(doc => {
const li = document.createElement("li"); const li = document.createElement("li");
const filename = doc.filename || doc.title || "未知文件"; const filename = doc.filename || doc.title || "未知文件";
const url = doc.url || ""; const filepath = doc.filepath?.replace(/^import-data\//, "").replace(/\.md$/, ".html") || "";
const mtime = doc.mtime ? formatLocalTime(doc.mtime) : ""; // 格式化时间 const mtime = doc.mtime ? formatLocalTime(doc.mtime) : ""; // 格式化时间
const link = document.createElement("a"); const link = document.createElement("a");
link.href = `${url}`; link.href = doc.url ? doc.url : `${fileBaseUrl}/${filepath || filename}`;
link.target = "_blank"; link.target = "_blank";
link.textContent = filename; link.textContent = filename;