From cee9ef9e732c7af670b0eea2791bcdc5e69aa2af Mon Sep 17 00:00:00 2001 From: Musiker15 Date: Wed, 25 Nov 2026 10:39:36 +0100 Subject: [PATCH] Fix the findings of the second OpenSpider crawl Every page named the root / as hreflang x-default. The root answers 307 and is the home page, so the crawler reported all 8,669 annotations as a non-200 target. x-default is now the English version of the same page, in the page metadata, both sitemaps and the bot landing pages. Pages 2 and up of a gallery category named page 1 as canonical and in hreflang (138 pages). Each page now names itself, with ?page=N in every language version, and gets "page N" in title and description. An empty category is noindex and no longer carries an hreflang pair. Next streamed the metadata for user agents outside its bot list. When it resolved after the shell, canonical and robots ended up after (2 of 6 requests for /de/web-tools/bilder/props). htmlLimitedBots now matches every user agent. Also: - Build assets under /_next/static and /_next/image get the security headers the proxy sets for documents. - Logo and web tool screenshots have alt text, the banners and screenshots carry width and height instead of fill. - The report link is a GET form, so the 8,478 image pages no longer have an internal nofollow link each. - Image titles keep the wording before falling back to "name PNG", and an image published in two categories (ammo in Items and Weapons) names the category in title and description. - Three titles over 60 and three descriptions over 155 characters are shorter. --- .../tools/images/[category]/[name]/page.tsx | 21 +++++++--- .../(site)/tools/images/[category]/page.tsx | 35 ++++++++++++++--- app/sitemap-images.xml/route.ts | 4 +- components/home/Bots.tsx | 6 ++- components/home/WebTools.tsx | 12 +++++- components/layout/Footer.tsx | 5 ++- components/layout/Header.tsx | 9 +++-- components/legal/ReportLink.tsx | 38 ++++++++++-------- lib/botSeo.ts | 12 +++--- lib/images.ts | 39 +++++++++++++++---- lib/pageSeo.ts | 2 +- lib/routes.ts | 3 -- lib/seo.ts | 24 ++++++++---- lib/sitemap.ts | 4 +- next.config.js | 34 ++++++++++++++++ tests/botLandingCopy.test.ts | 4 +- tests/imageListing.test.ts | 16 ++++++++ tests/nextConfig.test.ts | 31 +++++++++++++++ tests/seo.test.ts | 27 ++++++++++++- tests/sitemap.test.ts | 6 +-- 20 files changed, 260 insertions(+), 72 deletions(-) create mode 100644 tests/nextConfig.test.ts diff --git a/app/[lang]/(site)/tools/images/[category]/[name]/page.tsx b/app/[lang]/(site)/tools/images/[category]/[name]/page.tsx index 9bdf527..fb220e0 100644 --- a/app/[lang]/(site)/tools/images/[category]/[name]/page.tsx +++ b/app/[lang]/(site)/tools/images/[category]/[name]/page.tsx @@ -12,7 +12,7 @@ import { Card } from '@/components/ui/Card' import { alternatesFor } from '@/lib/seo' import { getRequestLang } from '@/lib/serverLang' import { imagesTranslations, type Lang } from '@/lib/i18n' -import { getImage, getNeighbours, imageTitle, listCategories } from '@/lib/images' +import { getImage, getNeighbours, imageTitle, inOtherCategory, listCategories } from '@/lib/images' import { absoluteUrl } from '@/lib/siteUrl' import { publicPath } from '@/lib/routes' @@ -32,11 +32,22 @@ export async function generateMetadata({ params }: { params: Params }): Promise< const image = await getImage(category, name.toLowerCase()) if (!image) return {} + // An image in two categories (ammo in Items and Weapons) has two pages with + // the same picture. The category in title and description tells them apart. + const [categories, shared] = await Promise.all([ + listCategories(lang), + inOtherCategory(category, image.name), + ]) + const where = shared ? categories.find(c => c.slug === category)?.name : undefined const display = image.label || image.name - const title = imageTitle(image, lang) - const description = lang === 'de' - ? `Freigestelltes ${display}-Bild aus GTA V, ${image.width} mal ${image.height} Pixel, kostenlos für FiveM-Scripts. Direkt über die CDN-URL nutzbar.` - : `Transparent ${display} image from GTA V, ${image.width} by ${image.height} pixels, free for FiveM scripts. Use the CDN URL directly.` + const title = imageTitle(image, lang, where) + const lead = lang === 'de' + ? `Freigestelltes ${display}-Bild aus GTA V${where ? ` (${where})` : ''}, ${image.width} mal ${image.height} Pixel, kostenlos für FiveM-Scripts.` + : `Transparent ${display} image from GTA V${where ? ` (${where})` : ''}, ${image.width} by ${image.height} pixels, free for FiveM scripts.` + const tail = lang === 'de' ? ' Direkt über die CDN-URL nutzbar.' : ' Use the CDN URL directly.' + // A long label pushed the description past the 155 characters a search + // result shows. The CDN hint is the part that can go. + const description = (lead + tail).length <= 155 ? lead + tail : lead return { title, diff --git a/app/[lang]/(site)/tools/images/[category]/page.tsx b/app/[lang]/(site)/tools/images/[category]/page.tsx index 2685826..986e26f 100644 --- a/app/[lang]/(site)/tools/images/[category]/page.tsx +++ b/app/[lang]/(site)/tools/images/[category]/page.tsx @@ -21,17 +21,34 @@ async function findCategory(slug: string, lang: Lang) { return categories.find(c => c.slug === slug) ?? null } -export async function generateMetadata({ params }: { params: Params }): Promise { +export async function generateMetadata( + { params, searchParams }: { params: Params; searchParams: Search }, +): Promise { const { category: slug } = await params + const { q = '', page: rawPage = '1' } = await searchParams const { lang } = await getRequestLang() const category = await findCategory(slug, lang) if (!category) return {} + // Every page of the list stands for itself: it shows other images than page + // 1, so it names itself as canonical and its own counterpart in the other + // language. Until 25.11.2026 pages 2 and up named page 1 in both, and a + // crawler reported 138 pages without a self reference or return link. A + // search (`?q=`) still points to the plain category. + const page = Math.max(1, Math.floor(Number(rawPage)) || 1) + const pages = Math.max(1, Math.ceil(category.count / DEFAULT_PER_PAGE)) + const paged = !q && page > 1 && page <= pages + const query = paged ? `?page=${page}` : '' + const pageSuffix = paged ? (lang === 'de' ? `, Seite ${page}` : `, page ${page}`) : '' + const pageNote = paged + ? (lang === 'de' ? ` Seite ${page} von ${pages}.` : ` Page ${page} of ${pages}.`) + : '' + // Curated like the package pages: the raw category name ("Vehicles") is // worthless as a title; people search for what the images are. - const title = lang === 'de' + const title = (lang === 'de' ? `${category.name} Bilder für FiveM` - : `FiveM ${category.name} Images` + : `FiveM ${category.name} Images`) + pageSuffix // `brand` holds our own logos and banners, not game content. Until // 05.09.2026 the GTA wording covered that category too, so the search result // description claimed the opposite of what the rights notice on the very same @@ -47,7 +64,9 @@ export async function generateMetadata({ params }: { params: Params }): Promise< // A category without a published image is a page with nothing on it. It // stays reachable, so a link to it does not break, but it stays out of the - // index, with a description that does not start with "0 images". + // index, with a description that does not start with "0 images". It names no + // language versions: an hreflang pair between two noindex pages points + // search engines at something they must not show. if (category.count === 0) { return { title, @@ -55,11 +74,15 @@ export async function generateMetadata({ params }: { params: Params }): Promise< ? `In dieser Kategorie ist noch kein Bild veröffentlicht. Die anderen Kategorien der Bildergalerie sind frei für FiveM-Scripts nutzbar.` : `No image has been published in this category yet. The other categories of the image gallery are free to use in FiveM scripts.`, robots: { index: false, follow: true }, - alternates: alternatesFor(lang, `/tools/images/${slug}`), + alternates: { canonical: alternatesFor(lang, `/tools/images/${slug}`).canonical }, } } - return { title, description, alternates: alternatesFor(lang, `/tools/images/${slug}`) } + return { + title, + description: description + pageNote, + alternates: alternatesFor(lang, `/tools/images/${slug}`, query), + } } export default async function CategoryPage( diff --git a/app/sitemap-images.xml/route.ts b/app/sitemap-images.xml/route.ts index 5be64b5..0277dfb 100644 --- a/app/sitemap-images.xml/route.ts +++ b/app/sitemap-images.xml/route.ts @@ -1,6 +1,6 @@ import { listCategories, listImages, MAX_PER_PAGE } from '@/lib/images' import { absoluteUrl } from '@/lib/siteUrl' -import { X_DEFAULT_PATH, alternatePaths } from '@/lib/routes' +import { alternatePaths } from '@/lib/routes' /** * Image sitemap. @@ -59,7 +59,7 @@ export async function GET() { ` ${escapeXml(absoluteUrl(alt.en))}`, ` `, ` `, - ` `, + ` `, ' ', ` ${escapeXml(image.url)}`, ` ${escapeXml(image.label || image.name)}`, diff --git a/components/home/Bots.tsx b/components/home/Bots.tsx index e2234a5..fa09cf9 100644 --- a/components/home/Bots.tsx +++ b/components/home/Bots.tsx @@ -56,9 +56,11 @@ export function Bots({ lang, ticketFrom }: { lang: Lang; ticketFrom: string }) { // The banner shows logo and wordmark of the bot, so it says // something and is named after it. alt={`MSK ${bot.name}`} - fill + // The banner's own size, so the img carries it in the HTML. + width={1920} + height={1080} sizes="(max-width: 767px) 100vw, (max-width: 1599px) 50vw, 40vw" - className="object-cover" + className="h-full w-full object-cover" />
diff --git a/components/home/WebTools.tsx b/components/home/WebTools.tsx index 8cd2340..149c759 100644 --- a/components/home/WebTools.tsx +++ b/components/home/WebTools.tsx @@ -40,7 +40,17 @@ export function WebTools({ lang }: { lang: Lang }) {
  • {tool.image && (
    - + {/* Width and height give the box's 16:9, the screenshots differ + and are cropped to it. Without them the img carries no size + in the HTML, which a crawler reports. */} + {lang
    )}

    {tool.name}

    diff --git a/components/layout/Footer.tsx b/components/layout/Footer.tsx index c86d565..9c36c8a 100644 --- a/components/layout/Footer.tsx +++ b/components/layout/Footer.tsx @@ -162,8 +162,9 @@ export function Footer() {
    - - MSK Scripts + {/* The logo names the link, the written name is only seen. */} + MSK Scripts +

    {t.action_theme}

    diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index 69ec4d4..0d4a8c4 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -59,10 +59,11 @@ function SignInReturn() { function Brand() { return ( - - {/* Below 360 px the name gives way to the menu; it stays the link's - name for a screen reader. */} - + {/* The logo carries the link's name, so a screen reader hears it once + and it stays there below 360 px, where the written name gives way to + the menu. */} + MSK Scripts + diff --git a/components/legal/ReportLink.tsx b/components/legal/ReportLink.tsx index d6f68a0..f87c758 100644 --- a/components/legal/ReportLink.tsx +++ b/components/legal/ReportLink.tsx @@ -2,7 +2,6 @@ import { Flag } from '@/components/icons' -import { LocaleLink as Link } from '@/components/i18n/LocaleLink' import { useLang } from '@/components/i18n/LangProvider' import { layoutTranslations } from '@/lib/i18n' import { absoluteUrl } from '@/lib/siteUrl' @@ -14,6 +13,8 @@ import { absoluteUrl } from '@/lib/siteUrl' // die URL von Hand abtippen lässt, ist beides nicht — deshalb sitzt der Link // am Inhalt selbst und bringt die Adresse mit. // +// The trigger is a button in a GET form, see below. +// // The caller passes the internal path; it becomes the absolute public address // here, because the report form should hold the address a third party sees in // the browser, not an internal path. @@ -22,22 +23,25 @@ export function ReportLink({ path, className }: { path: string; className?: stri const { lang, localize } = useLang() const label = layoutTranslations[lang].legal_report + // A GET form instead of a link. Every image page carries it with its own + // address, 8,478 in the crawl of 24.11.2026. As a link with `nofollow` each + // of them was an internal nofollow outlink in the next crawl. A form is not + // followed by crawlers, and for a visitor the button opens the same address + // the link did. return ( - -