fix: use created property as published date (Obsidian default), fall back to date

This commit is contained in:
svemagie
2026-03-14 18:10:58 +01:00
parent e6d1d7baaa
commit 21a398f1ad
2 changed files with 12 additions and 10 deletions
+8 -7
View File
File diff suppressed because one or more lines are too long
+4 -3
View File
@@ -117,9 +117,10 @@ export class Publisher {
props["summary"] = [String(fm["summary"] ?? fm["excerpt"])];
}
// Published date
if (fm["date"]) {
props["published"] = [new Date(String(fm["date"])).toISOString()];
// Published date — prefer `created` (Obsidian default), fall back to `date`
const rawDate = fm["created"] ?? fm["date"];
if (rawDate) {
props["published"] = [new Date(String(rawDate)).toISOString()];
}
// Categories from frontmatter `category` or `tags` (excluding garden/* tags)