feat: hide metadata type images offscreen for seo
This commit is contained in:
parent
24b9091c05
commit
817baf7970
2 changed files with 13 additions and 2 deletions
|
|
@ -90,9 +90,8 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
|
||||||
|
|
||||||
const name = slugify(mii.name);
|
const name = slugify(mii.name);
|
||||||
const tags = mii.tags.map(slugify).join("-");
|
const tags = mii.tags.map(slugify).join("-");
|
||||||
const username = slugify(mii.user.username!);
|
|
||||||
|
|
||||||
const filename = `${name}-mii-${tags}-by-${username}.png`;
|
const filename = `${name}-mii-${tags}.png`;
|
||||||
|
|
||||||
return rateLimit.sendResponse(buffer, 200, {
|
return rateLimit.sendResponse(buffer, 200, {
|
||||||
"Content-Type": "image/png",
|
"Content-Type": "image/png",
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ export default async function MiiList({ searchParams, userId, inLikesPage }: Pro
|
||||||
imageCount: true,
|
imageCount: true,
|
||||||
tags: true,
|
tags: true,
|
||||||
createdAt: true,
|
createdAt: true,
|
||||||
|
gender: true,
|
||||||
// Mii liked check
|
// Mii liked check
|
||||||
...(session?.user?.id && {
|
...(session?.user?.id && {
|
||||||
likedBy: {
|
likedBy: {
|
||||||
|
|
@ -252,6 +253,17 @@ export default async function MiiList({ searchParams, userId, inLikesPage }: Pro
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Offscreen metadata image for search engines; hidden from users */}
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={`/mii/${mii.id}/image?type=metadata`}
|
||||||
|
alt={`${mii.name}, a ${mii.gender ? mii.gender.toLowerCase() : ""} Mii ${mii.tags.length ? ` with tags: ${mii.tags.join(", ")}` : ""}`}
|
||||||
|
loading="lazy"
|
||||||
|
width={1}
|
||||||
|
height={1}
|
||||||
|
className="absolute left-[999999]"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue