Add noindex to pages that should be private (#5257)

* Add noindex to pages that should be private

* fix unused
This commit is contained in:
Prospector
2026-01-30 13:04:19 -08:00
committed by GitHub
parent 0875a8a0bc
commit cefa7b90ed
10 changed files with 41 additions and 41 deletions

View File

@@ -2057,6 +2057,10 @@ if (!route.name.startsWith('type-id-settings')) {
? 'all'
: 'noindex',
})
} else {
useSeoMeta({
robots: 'noindex',
})
}
const onUserCollectProject = useClientTry(userCollectProject)

View File

@@ -0,0 +1,8 @@
<script setup lang="ts">
useSeoMeta({
robots: 'noindex',
})
</script>
<template>
<NuxtPage />
</template>

View File

@@ -2,6 +2,10 @@
definePageMeta({
middleware: ['launcher-auth'],
})
useSeoMeta({
robots: 'noindex',
})
</script>
<template>
<NuxtPage class="auth-container universal-card" />

View File

@@ -60,5 +60,9 @@ definePageMeta({
middleware: 'auth',
})
useSeoMeta({
robots: 'noindex',
})
const route = useNativeRoute()
</script>

View File

@@ -29,6 +29,10 @@ const filteredFlags = computed(() => {
}
return fuse.value.search(searchQuery.value).map((result) => result.item)
})
useSeoMeta({
robots: 'noindex',
})
</script>
<template>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { defineMessages, useRelativeTime, useVIntl } from '@modrinth/ui'
import { defineMessages, useVIntl } from '@modrinth/ui'
const vintl = useVIntl()
const { formatMessage } = vintl
@@ -17,36 +17,11 @@ const messages = defineMessages({
id: 'frog.altText',
defaultMessage: 'A photorealistic painting of a frog labyrinth',
},
frogSinceOpened: {
id: 'frog.sinceOpened',
defaultMessage: 'This page was opened {ago}',
},
frogFroggedPeople: {
id: 'frog.froggedPeople',
defaultMessage:
'{count, plural, one {{count} more person} other {{count} more people}} were also frogged!',
},
})
const formatCompactNumber = useCompactNumber()
const formatRelativeTime = useRelativeTime()
const pageOpen = useState('frogPageOpen', () => Date.now())
const peopleFrogged = useState('frogPeopleFrogged', () => Math.round(Math.random() * 100_000_000))
const peopleFroggedCount = computed(() => formatCompactNumber(peopleFrogged.value))
let interval: ReturnType<typeof setTimeout>
const formattedOpenedCounter = ref(formatRelativeTime(Date.now()))
onMounted(() => {
interval = setInterval(() => {
formattedOpenedCounter.value = formatRelativeTime(pageOpen.value)
}, 1000)
useSeoMeta({
robots: 'noindex',
})
onUnmounted(() => clearInterval(interval))
</script>
<template>
@@ -54,8 +29,6 @@ onUnmounted(() => clearInterval(interval))
<h1>{{ formatMessage(messages.frogTitle) }}</h1>
<p>{{ formatMessage(messages.frogDescription) }}</p>
<img src="https://cdn.modrinth.com/frog.png" :alt="formatMessage(messages.frogAltText)" />
<p>{{ formatMessage(messages.frogSinceOpened, { ago: formattedOpenedCounter }) }}</p>
<p>{{ formatMessage(messages.frogFroggedPeople, { count: peopleFroggedCount }) }}</p>
</div>
</template>

View File

@@ -1,11 +0,0 @@
<template>
<div class="flex h-full w-full flex-col">
<div
class="flex items-center justify-between gap-2 border-0 border-b border-solid border-bg-raised p-3"
>
<h2 class="m-0 text-2xl font-bold text-contrast">Admin</h2>
</div>
</div>
</template>
<script setup lang="ts"></script>

View File

@@ -26,6 +26,10 @@ definePageMeta({
middleware: 'auth',
})
useSeoMeta({
robots: 'noindex',
})
const { formatMessage } = useVIntl()
const route = useRoute()
const router = useRouter()

View File

@@ -300,6 +300,12 @@ const config = useRuntimeConfig()
const orgId = useRouteId()
if (route.path.includes('settings')) {
useSeoMeta({
robots: 'noindex',
})
}
// hacky way to show the edit button on the corner of the card.
const routeHasSettings = computed(() => route.path.includes('settings'))

View File

@@ -101,4 +101,8 @@ const { formatMessage } = useVIntl()
const route = useNativeRoute()
const auth = await useAuth()
useSeoMeta({
robots: 'noindex',
})
</script>