From 5c417a1b752ef4122359fdddc9f5238d8fda2867 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 12 Oct 2024 14:13:30 +0200 Subject: [PATCH] feat: add sitemap --- astro.config.mjs | 3 ++- package.json | 1 + pnpm-lock.yaml | 46 ++++++++++++++++++++++++++++++++++++++++ public/robots.txt | 2 ++ src/layouts/Layout.astro | 1 + 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index c4a7d51..b81738a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -4,12 +4,13 @@ import markdoc from '@astrojs/markdoc' import rehypeSlug from 'rehype-slug' import rehypeAutolinkHeadings from 'rehype-autolink-headings' import node from '@astrojs/node' +import sitemap from '@astrojs/sitemap' // https://astro.build/config export default defineConfig({ site: 'https://vikunja.io', output: 'hybrid', - integrations: [tailwind(), markdoc()], + integrations: [tailwind(), markdoc(), sitemap()], adapter: node({ mode: 'standalone', }), diff --git a/package.json b/package.json index 6f98722..974fbd1 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@astrojs/cloudflare": "^11.0.1", "@astrojs/markdoc": "^0.11.0", "@astrojs/node": "^8.3.2", + "@astrojs/sitemap": "^3.2.0", "@astrojs/tailwind": "^5.1.0", "@fontsource/open-sans": "^5.0.28", "@fontsource/quicksand": "^5.0.18", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40ae259..e101c3b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@astrojs/node': specifier: ^8.3.2 version: 8.3.4(astro@4.15.11(@types/node@22.5.5)(rollup@4.24.0)(typescript@5.6.3)) + '@astrojs/sitemap': + specifier: ^3.2.0 + version: 3.2.0 '@astrojs/tailwind': specifier: ^5.1.0 version: 5.1.1(astro@4.15.11(@types/node@22.5.5)(rollup@4.24.0)(typescript@5.6.3))(tailwindcss@3.4.13) @@ -127,6 +130,9 @@ packages: resolution: {integrity: sha512-Z9IYjuXSArkAUx3N6xj6+Bnvx8OdUSHA8YoOgyepp3+zJmtVYJIl/I18GozdJVW1p5u/CNpl3Km7/gwTJK85cw==} engines: {node: ^18.17.1 || ^20.3.0 || >=21.0.0} + '@astrojs/sitemap@3.2.0': + resolution: {integrity: sha512-SkrOCL3Z6HxdiXreZ1+aPBWgnBMJ31EgPdcscgQeLqI2Gqk/4EKLuw9q0SqKU9MmHpcPXXtcd0odfCk4barPoA==} + '@astrojs/tailwind@5.1.1': resolution: {integrity: sha512-LwurA10uIKcGRxQP2R81RvAnBT0WPKzBntXZBF4hrAefDgM5Uumn0nsGr6tdIjSARgYz4X+Cq/Vh78t3bql3yw==} peerDependencies: @@ -926,12 +932,18 @@ packages: '@types/node-forge@1.3.11': resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} + '@types/node@17.0.45': + resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + '@types/node@18.19.55': resolution: {integrity: sha512-zzw5Vw52205Zr/nmErSEkN5FLqXPuKX/k5d1D7RKHATGqU7y6YfX9QxZraUzUrFGqH6XzOzG196BC35ltJC4Cw==} '@types/node@22.5.5': resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/unist@3.0.2': resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} @@ -2280,6 +2292,9 @@ packages: run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + sax@1.4.1: + resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} + section-matter@1.0.0: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} engines: {node: '>=4'} @@ -2332,6 +2347,11 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + sitemap@8.0.0: + resolution: {integrity: sha512-+AbdxhM9kJsHtruUF39bwS/B0Fytw6Fr1o4ZAIAEqA6cke2xcoO2GleBw9Zw7nRzILVEgz7zBM5GiTJjie1G9A==} + engines: {node: '>=14.0.0', npm: '>=6.0.0'} + hasBin: true + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -2365,6 +2385,9 @@ packages: resolution: {integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==} engines: {node: '>=4', npm: '>=6'} + stream-replace-string@2.0.0: + resolution: {integrity: sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -2963,6 +2986,12 @@ snapshots: dependencies: prismjs: 1.29.0 + '@astrojs/sitemap@3.2.0': + dependencies: + sitemap: 8.0.0 + stream-replace-string: 2.0.0 + zod: 3.23.8 + '@astrojs/tailwind@5.1.1(astro@4.15.11(@types/node@22.5.5)(rollup@4.24.0)(typescript@5.6.3))(tailwindcss@3.4.13)': dependencies: astro: 4.15.11(@types/node@22.5.5)(rollup@4.24.0)(typescript@5.6.3) @@ -3633,6 +3662,8 @@ snapshots: dependencies: '@types/node': 22.5.5 + '@types/node@17.0.45': {} + '@types/node@18.19.55': dependencies: undici-types: 5.26.5 @@ -3641,6 +3672,10 @@ snapshots: dependencies: undici-types: 6.19.8 + '@types/sax@1.2.7': + dependencies: + '@types/node': 22.5.5 + '@types/unist@3.0.2': {} '@types/unist@3.0.3': {} @@ -5306,6 +5341,8 @@ snapshots: dependencies: queue-microtask: 1.2.3 + sax@1.4.1: {} + section-matter@1.0.0: dependencies: extend-shallow: 2.0.1 @@ -5391,6 +5428,13 @@ snapshots: sisteransi@1.0.5: {} + sitemap@8.0.0: + dependencies: + '@types/node': 17.0.45 + '@types/sax': 1.2.7 + arg: 5.0.2 + sax: 1.4.1 + source-map-js@1.2.1: {} source-map@0.6.1: {} @@ -5412,6 +5456,8 @@ snapshots: stoppable@1.1.0: {} + stream-replace-string@2.0.0: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 diff --git a/public/robots.txt b/public/robots.txt index dfac786..aaccff6 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,2 +1,4 @@ User-agent: * Disallow: /_astro/ + +Sitemap: https://vikunja.io/sitemap-index.xml \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6dd7297..b4816b5 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -39,6 +39,7 @@ const canonical = base.endsWith('/') +