diigo-cache: public list shows each bookmark's date first
The list is in diigo's updated order; each item now leads with its updated_at as Date#toISOString() (diigo sends epoch seconds; updatedISO converts, tested), or "(no date)". Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
80c9279825
commit
860bbee2b5
4 files changed
+26
-3
No files matched your search
@@ -15,7 +15,7 @@
|
||||
import { WorkerEntrypoint } from "cloudflare:workers";
|
||||
import { DiigoCache, PublicCache } from "./cache.js";
|
||||
import type { Item } from "./cache.js";
|
||||
import { usernameOf } from "./items.js";
|
||||
import { updatedISO, usernameOf } from "./items.js";
|
||||
import { toWebkey, idFromWebkey, isWebkey, shashKey } from "./webkeys.js";
|
||||
import { pmSave } from "./pm-save.js";
|
||||
|
||||
@@ -457,7 +457,9 @@ ${items
|
||||
const title = typeof it.title === "string" && it.title ? it.title : url;
|
||||
const desc = typeof it.description === "string" && it.description ? `<br><small>${esc(it.description)}</small>` : "";
|
||||
const href = /^https?:\/\//i.test(url) ? url : "#";
|
||||
return `<li><a href="${esc(href)}">${esc(title)}</a>${desc}</li>`;
|
||||
const when = updatedISO(it);
|
||||
const date = when ? `<time datetime="${when}">${when}</time>` : "(no date)";
|
||||
return `<li>${date} <a href="${esc(href)}">${esc(title)}</a>${desc}</li>`;
|
||||
})
|
||||
.join("\n")}
|
||||
</ol>`;
|
||||
|
||||
Reference in new issue
Block a user