From ae8fb0e47ffab7dea543b7c5595e6f0128309f24 Mon Sep 17 00:00:00 2001 From: chyzman Date: Sat, 22 Aug 2026 18:46:44 -0400 Subject: [PATCH 1/2] tell search engines not to index collections because bots keep spamming them and I can basically guarantee not a single human being is using collections in a way where this will be detrimental to them (besides the advertisement spam) --- apps/frontend/src/pages/collection/[collection].vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/frontend/src/pages/collection/[collection].vue b/apps/frontend/src/pages/collection/[collection].vue index 3049dcf6f7..dc2f568482 100644 --- a/apps/frontend/src/pages/collection/[collection].vue +++ b/apps/frontend/src/pages/collection/[collection].vue @@ -410,6 +410,10 @@ import { onServerPrefetch } from 'vue' import AdPlaceholder from '~/components/ui/AdPlaceholder.vue' +useSeoMeta({ + robots: 'noindex', +}) + const { handleError } = injectNotificationManager() const api = injectModrinthClient() const { formatMessage } = useVIntl() From d3c9780bf7cd687044de2ec74c8870af1e1b15fc Mon Sep 17 00:00:00 2001 From: chyzman Date: Tue, 25 Aug 2026 15:06:42 -0400 Subject: [PATCH 2/2] Index creator created collections --- .../src/pages/collection/[collection].vue | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/pages/collection/[collection].vue b/apps/frontend/src/pages/collection/[collection].vue index dc2f568482..e5ded1fc83 100644 --- a/apps/frontend/src/pages/collection/[collection].vue +++ b/apps/frontend/src/pages/collection/[collection].vue @@ -618,6 +618,26 @@ const creator = computed(() => const supportsMarkdown = computed(() => creator.value?.id === '2REoufqX') +// Query for public projects +const { data: creatorPublicProjectsSearch } = useQuery({ + queryKey: computed(() => ['user', creator.value?.username, 'public-projects-search']), + queryFn: () => + api.labrinth.projects_v3.search({ + facets: [[`author:${creator.value.username}`]], + limit: 1, + }), + enabled: computed( + () => + !isFollowingCollection.value && + collection.value?.status === 'listed' && + !!creator.value?.username, + ), +}) + +const creatorHasPublicProjects = computed( + () => (creatorPublicProjectsSearch.value?.total_hits ?? 0) > 0, +) + // Query for followed projects const { data: followedProjects, @@ -677,10 +697,21 @@ onServerPrefetch(async () => { }) if (collectionData?.user) { - await queryClient.ensureQueryData({ + const creatorData = await queryClient.ensureQueryData({ queryKey: ['user', collectionData.user], queryFn: () => api.labrinth.users_v2.get(collectionData.user), }) + + if (collectionData.status === 'listed' && creatorData?.username) { + await queryClient.ensureQueryData({ + queryKey: ['user', creatorData.username, 'public-projects-search'], + queryFn: () => + api.labrinth.projects_v3.search({ + facets: [[`author:${creatorData.username}`]], + limit: 1, + }), + }) + } } if (collectionData?.projects?.length) { @@ -692,8 +723,8 @@ onServerPrefetch(async () => { }) watch( - [collection, creator], - ([col, cre]) => { + [collection, creator, creatorHasPublicProjects], + ([col, cre, hasPublicProjects]) => { if (col && cre) { const canonicalUrl = col ? `https://modrinth.com/collection/${col.id}` : undefined useSeoMeta({ @@ -707,7 +738,7 @@ watch( ogDescription: col.description, ogImage: col.icon_url ?? 'https://cdn-raw.modrinth.com/placeholder-square.png', ogUrl: canonicalUrl, - robots: col.status === 'listed' ? 'all' : 'noindex', + robots: col.status === 'listed' && hasPublicProjects ? 'all' : 'noindex', }) useHead({ link: [