fix favicon
This commit is contained in:
@@ -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`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user