fix favicon

This commit is contained in:
2026-01-16 11:15:25 +09:00
parent 5d12d8b0dc
commit 2533720014
4 changed files with 12 additions and 9 deletions

View File

@@ -307,14 +307,15 @@ export async function searchPostsForUrl(url: string): Promise<any[]> {
return allPosts
}
export function getServiceInfo(collection: string): { name: string; domain: string; favicon: string } | null {
export function getServiceInfo(collection: string): { name: string; domain: string; favicon: string; faviconFallback: string } | null {
// Try to find matching service prefix
for (const [prefix, info] of Object.entries(SERVICE_MAP)) {
if (collection.startsWith(prefix)) {
return {
name: info.domain,
domain: info.domain,
favicon: info.icon || `https://www.google.com/s2/favicons?domain=${info.domain}&sz=32`
favicon: `/favicons/${info.domain}.png`,
faviconFallback: info.icon || `https://www.google.com/s2/favicons?domain=${info.domain}&sz=32`
}
}
}
@@ -326,7 +327,8 @@ export function getServiceInfo(collection: string): { name: string; domain: stri
return {
name: domain,
domain: domain,
favicon: `https://www.google.com/s2/favicons?domain=${domain}&sz=32`
favicon: `/favicons/${domain}.png`,
faviconFallback: `https://www.google.com/s2/favicons?domain=${domain}&sz=32`
}
}