From fc64719bb841545da12ceadafaa4805928b01736 Mon Sep 17 00:00:00 2001 From: Emma Alexia Triphora Date: Fri, 22 Sep 2023 12:45:03 -0400 Subject: [PATCH] SEO cleanup (#1367) * SEO/Metadata cleanup May split rules changes into its own PR * Revert rules/terms changes as they are now on a separate branch * Update [searchProjectType].vue * Update terms.vue --- layouts/default.vue | 29 +++++- nuxt.config.ts | 22 ----- pages/[type]/[id].vue | 52 +++++----- pages/[type]/[id]/changelog.vue | 19 ++-- pages/[type]/[id]/gallery.vue | 121 ++++++++++-------------- pages/[type]/[id]/index.vue | 2 - pages/[type]/[id]/settings/license.vue | 1 - pages/[type]/[id]/version/[version].vue | 41 ++++---- pages/[type]/[id]/versions.vue | 29 +++--- pages/app.vue | 20 ++-- pages/dashboard.vue | 1 - pages/dashboard/analytics.vue | 1 - pages/dashboard/follows.vue | 1 - pages/dashboard/reports.vue | 1 - pages/legal.vue | 22 +++-- pages/legal/ccpa.vue | 39 ++------ pages/legal/cmp-info.vue | 39 ++------ pages/legal/cmp.vue | 39 ++------ pages/legal/copyright.vue | 39 ++------ pages/legal/privacy.vue | 39 ++------ pages/legal/rules.vue | 39 ++------ pages/legal/security.vue | 39 ++------ pages/legal/terms.vue | 39 ++------ pages/moderation.vue | 1 - pages/moderation/reports.vue | 1 - pages/search/[searchProjectType].vue | 32 +++---- pages/settings.vue | 2 - pages/settings/index.vue | 1 - pages/user/[id].vue | 23 ++--- 29 files changed, 261 insertions(+), 473 deletions(-) diff --git a/layouts/default.vue b/layouts/default.vue index 4ae2ad02..b474b1af 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -391,7 +391,6 @@ const config = useRuntimeConfig() const route = useRoute() const link = config.public.siteUrl + route.path.replace(/\/+$/, '') useHead({ - meta: [{ name: 'og:url', content: link }], link: [ { rel: 'canonical', @@ -400,6 +399,34 @@ useHead({ ], }) +const description = + 'Download Minecraft mods, plugins, datapacks, shaders, resourcepacks, and modpacks on Modrinth. ' + + 'Discover and publish projects on Modrinth with a modern, easy to use interface and API.' + +useSeoMeta({ + title: 'Modrinth', + description, + publisher: 'Rinth, Inc.', + themeColor: [ + { color: '#1bd96a', media: '(prefers-color-scheme:no-preference)' }, + { color: '#1bd96a', media: '(prefers-color-scheme:dark)' }, + { color: '#00af5c', media: '(prefers-color-scheme:light)' }, + ], + colorScheme: 'dark light', + + // OpenGraph + ogTitle: 'Modrinth', + ogSiteName: 'Modrinth', + ogDescription: description, + ogType: 'website', + ogImage: 'https://cdn.modrinth.com/modrinth-new.png', + ogUrl: link, + + // Twitter + twitterCard: 'summary', + twitterSite: '@modrinth', +}) + let developerModeCounter = 0 function developerModeIncrement() { diff --git a/nuxt.config.ts b/nuxt.config.ts index b163cc14..d1162404 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -22,25 +22,6 @@ const favicons = { '(prefers-color-scheme:dark)': '/favicon.ico', } -const meta = { - description: - 'Download Minecraft mods, plugins, datapacks, shaders, resourcepacks, and modpacks on Modrinth. Discover and publish projects on Modrinth with a modern, easy to use interface and API.', - publisher: 'Rinth, Inc.', - 'apple-mobile-web-app-title': 'Modrinth', - 'theme-color': '#1bd96a', - 'color-scheme': 'dark light', - // OpenGraph - 'og:title': 'Modrinth', - 'og:site_name': 'Modrinth', - 'og:description': 'An open source modding platform', - 'og:type': 'website', - 'og:url': 'https://modrinth.com', - 'og:image': 'https://cdn.modrinth.com/modrinth-new.png?', - // Twitter - 'twitter:card': 'summary', - 'twitter:site': '@modrinth', -} - /** * Tags of locales that are auto-discovered besides the default locale. * @@ -70,9 +51,6 @@ export default defineNuxtConfig({ lang: 'en', }, title: 'Modrinth', - meta: Object.entries(meta).map(([name, content]): object => { - return { name, content } - }), link: [ // The type is necessary because the linter can't always compare this very nested/complex type on itself ...preloadedFonts.map((font): object => { diff --git a/pages/[type]/[id].vue b/pages/[type]/[id].vue index c9accfa3..c978a889 100644 --- a/pages/[type]/[id].vue +++ b/pages/[type]/[id].vue @@ -125,31 +125,6 @@
- - {{ project.title }} - Minecraft {{ projectTypeDisplay }} - - - - - - - - - - diff --git a/pages/legal/rules.vue b/pages/legal/rules.vue index dde99914..e4f9d943 100644 --- a/pages/legal/rules.vue +++ b/pages/legal/rules.vue @@ -134,35 +134,14 @@
- - - diff --git a/pages/legal/security.vue b/pages/legal/security.vue index 577f5b1c..94c4ee33 100644 --- a/pages/legal/security.vue +++ b/pages/legal/security.vue @@ -52,35 +52,14 @@ - - - diff --git a/pages/legal/terms.vue b/pages/legal/terms.vue index bbe4d3e2..e6443629 100644 --- a/pages/legal/terms.vue +++ b/pages/legal/terms.vue @@ -583,35 +583,14 @@ - - - diff --git a/pages/moderation.vue b/pages/moderation.vue index 3cf2b478..82c547a9 100644 --- a/pages/moderation.vue +++ b/pages/moderation.vue @@ -37,4 +37,3 @@ definePageMeta({ middleware: 'auth', }) - diff --git a/pages/moderation/reports.vue b/pages/moderation/reports.vue index 44c9d454..67c07649 100644 --- a/pages/moderation/reports.vue +++ b/pages/moderation/reports.vue @@ -14,4 +14,3 @@ useHead({ title: 'Reports - Modrinth', }) - diff --git a/pages/search/[searchProjectType].vue b/pages/search/[searchProjectType].vue index d6c1bc86..9da784bd 100644 --- a/pages/search/[searchProjectType].vue +++ b/pages/search/[searchProjectType].vue @@ -7,17 +7,7 @@ }" > - Search {{ $formatProjectType(projectType.display) }}s - Modrinth - - - - + Search {{ projectType.display }}s - Modrinth