mirror of
https://github.com/svemagie/obsidian-micropub.git
synced 2026-05-16 04:18:51 +02:00
fix: use created property as published date (Obsidian default), fall back to date
This commit is contained in:
+4
-3
@@ -117,9 +117,10 @@ export class Publisher {
|
|||||||
props["summary"] = [String(fm["summary"] ?? fm["excerpt"])];
|
props["summary"] = [String(fm["summary"] ?? fm["excerpt"])];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Published date
|
// Published date — prefer `created` (Obsidian default), fall back to `date`
|
||||||
if (fm["date"]) {
|
const rawDate = fm["created"] ?? fm["date"];
|
||||||
props["published"] = [new Date(String(fm["date"])).toISOString()];
|
if (rawDate) {
|
||||||
|
props["published"] = [new Date(String(rawDate)).toISOString()];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Categories from frontmatter `category` or `tags` (excluding garden/* tags)
|
// Categories from frontmatter `category` or `tags` (excluding garden/* tags)
|
||||||
|
|||||||
Reference in New Issue
Block a user