feat(post): add support for next.js image links

This commit is contained in:
Tom (plebeius.eth)
2024-09-17 18:01:11 +02:00
parent cadf416058
commit 5a9bf5b88b
+4
View File
@@ -75,6 +75,10 @@ export const getLinkMediaInfo = memoize(
let type: string = 'webpage';
let mime: string | undefined;
if (url.pathname === '/_next/image' && url.search.startsWith('?url=')) {
return { url: link, type: 'image' };
}
try {
const fileName = url.pathname.slice(url.pathname.lastIndexOf('/') + 1).toLowerCase();
mime = extName(fileName)[0]?.mime;