Fix robots & sitemap SEO disaster

This commit is contained in:
Andrew Illarionov 2024-06-19 19:05:58 +03:00
parent 00060ede92
commit 44469bd9f2
7 changed files with 42 additions and 34 deletions

View File

@ -137,32 +137,6 @@ export default defineNuxtConfig({
markdown: true, markdown: true,
}, },
}, },
// routeRules: {
// '/': {
// sitemap: {
// changefreq: 'yearly',
// priority: 1,
// },
// },
// '/about': {
// sitemap: {
// changefreq: 'yearly',
// priority: 0.6,
// },
// },
// '/projects': {
// sitemap: {
// changefreq: 'monthly',
// priority: 0.7,
// },
// },
// '/social': {
// sitemap: {
// changefreq: 'yearly',
// priority: 0.7,
// },
// },
// },
sitemap: { sitemap: {
sources: ['/api/__sitemap__/content'], sources: ['/api/__sitemap__/content'],
cacheMaxAgeSeconds: 360, cacheMaxAgeSeconds: 360,
@ -179,16 +153,11 @@ export default defineNuxtConfig({
}, },
], ],
defaults: { defaults: {
changefreq: 'yearly',
priority: 0.7,
lastmod: config.build.date, lastmod: config.build.date,
}, },
}, },
robots: { robots: {
enabled: true, enabled: false,
metaTag: true,
blockNonSeoBots: true,
credits: false,
}, },
tailwindcss: { tailwindcss: {
exposeConfig: true, exposeConfig: true,

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "enderapp", "name": "enderapp",
"version": "0.2.5", "version": "0.3.8",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "enderapp", "name": "enderapp",
"version": "0.2.5", "version": "0.3.8",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@date-io/date-fns": "^3.0.0", "@date-io/date-fns": "^3.0.0",

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineRouteRules } from '#imports'
const config = useAppConfig() const config = useAppConfig()
const age = const age =
new Date(Number(new Date()) - Number(new Date('2003-09-18'))).getFullYear() - new Date(Number(new Date()) - Number(new Date('2003-09-18'))).getFullYear() -
@ -38,6 +40,13 @@ useHead({
}, },
], ],
}) })
defineRouteRules({
sitemap: {
changefreq: 'yearly',
priority: 0.6,
},
})
</script> </script>
<template> <template>

View File

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { formatDate } from 'date-fns' import { formatDate } from 'date-fns'
import { defineRouteRules } from '#imports'
const config = useAppConfig() const config = useAppConfig()
const meta = { const meta = {
@ -37,6 +38,13 @@ useHead({
}, },
], ],
}) })
defineRouteRules({
sitemap: {
changefreq: 'monthly',
priority: 0.7,
},
})
</script> </script>
<template> <template>

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineRouteRules } from '#imports'
const config = useAppConfig() const config = useAppConfig()
const projects = [ const projects = [
{ {
@ -64,6 +66,13 @@ useHead({
}, },
], ],
}) })
defineRouteRules({
sitemap: {
changefreq: 'monthly',
priority: 0.7,
},
})
</script> </script>
<template> <template>

View File

@ -1,4 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineRouteRules } from '#imports'
const config = useAppConfig() const config = useAppConfig()
const fqdn = config.url.split('//')[1] const fqdn = config.url.split('//')[1]
@ -112,6 +114,13 @@ useHead({
}, },
], ],
}) })
defineRouteRules({
sitemap: {
changefreq: 'yearly',
priority: 0.7,
},
})
</script> </script>
<template> <template>

4
public/robots.txt Normal file
View File

@ -0,0 +1,4 @@
User-agent: *
Disallow:
Sitemap: https://enderman.ch/sitemap.xml