site: media + colocation — chunk 1/4 (code, configs, docs)
Code, configs, README, CHANGELOG, sources/log files, .claude. Subsequent chunks land the renamed media files.
This commit is contained in:
+23
-7
@@ -20,16 +20,15 @@ type Source = {
|
||||
notes: string;
|
||||
};
|
||||
|
||||
const sources: Source[] = [...sourcesData.sources].sort((a, b) =>
|
||||
a.name.localeCompare(b.name)
|
||||
);
|
||||
|
||||
const topicLabels: Record<string, string> = {
|
||||
'macos-apps': 'macOS apps',
|
||||
'apple-tips': 'apple tips',
|
||||
'tools': 'tools',
|
||||
'gifts': 'gifts',
|
||||
'clothing': 'clothing',
|
||||
'travel': 'travel',
|
||||
'quotes': 'quotes',
|
||||
'dad-jokes': 'dad jokes',
|
||||
'general-delight': 'general delight',
|
||||
};
|
||||
|
||||
@@ -48,10 +47,27 @@ for (const f of allFinds) {
|
||||
arr.push(f);
|
||||
findsBySource.set(f.data.source, arr);
|
||||
}
|
||||
for (const arr of findsBySource.values()) {
|
||||
arr.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
||||
}
|
||||
|
||||
const lastUpdated = allFinds.sort(
|
||||
(a, b) => b.data.date.valueOf() - a.data.date.valueOf()
|
||||
)[0]?.data.date;
|
||||
const sources: Source[] = [...sourcesData.sources].sort((a, b) => {
|
||||
const af = findsBySource.get(a.name) ?? [];
|
||||
const bf = findsBySource.get(b.name) ?? [];
|
||||
const aLatest = af[0]?.data.date.valueOf() ?? -Infinity;
|
||||
const bLatest = bf[0]?.data.date.valueOf() ?? -Infinity;
|
||||
if (aLatest !== bLatest) return bLatest - aLatest;
|
||||
if (af.length !== bf.length) return bf.length - af.length;
|
||||
return a.name.localeCompare(b.name);
|
||||
});
|
||||
|
||||
const lastUpdated = findsBySource.size
|
||||
? new Date(
|
||||
Math.max(
|
||||
...[...findsBySource.values()].map((arr) => arr[0].data.date.valueOf())
|
||||
)
|
||||
)
|
||||
: undefined;
|
||||
|
||||
const description = `The ${sources.length} feeds, shops, and forums Unique draws daily picks from.`;
|
||||
const ogImage = buildOgImage(undefined, 'site', 'Unique sources catalog');
|
||||
|
||||
Reference in New Issue
Block a user