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,
},
},
// 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: {
sources: ['/api/__sitemap__/content'],
cacheMaxAgeSeconds: 360,
@ -179,16 +153,11 @@ export default defineNuxtConfig({
},
],
defaults: {
changefreq: 'yearly',
priority: 0.7,
lastmod: config.build.date,
},
},
robots: {
enabled: true,
metaTag: true,
blockNonSeoBots: true,
credits: false,
enabled: false,
},
tailwindcss: {
exposeConfig: true,

4
package-lock.json generated
View File

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

View File

@ -1,4 +1,6 @@
<script setup lang="ts">
import { defineRouteRules } from '#imports'
const config = useAppConfig()
const age =
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>
<template>

View File

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

View File

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

View File

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

4
public/robots.txt Normal file
View File

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