From fc8e3a80380a24443dec576648c91bcb916209f1 Mon Sep 17 00:00:00 2001 From: xy <10816187@qq.com> Date: Mon, 17 Nov 2025 22:37:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20sitemap=20=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astro.config.mjs | 7 +++-- package.json | 1 + pnpm-lock.yaml | 51 +++++++++++++++++++++++++++++++++ src/components/BaseFooter.astro | 2 +- src/components/BaseHeader.astro | 2 +- src/layouts/Layout.astro | 20 +++++++++++-- 6 files changed, 76 insertions(+), 7 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index c302150..8416d19 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,7 +3,10 @@ import { defineConfig } from 'astro/config'; import solidJs from '@astrojs/solid-js'; +import sitemap from '@astrojs/sitemap'; + // https://astro.build/config export default defineConfig({ - integrations: [solidJs()] -}); \ No newline at end of file + site: 'https://ua42.com', + integrations: [solidJs(), sitemap()] +}); diff --git a/package.json b/package.json index c99c723..588faf5 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "deploy": "./scripts/deploy.sh" }, "dependencies": { + "@astrojs/sitemap": "^3.6.0", "@astrojs/solid-js": "^5.1.3", "astro": "^5.15.8", "modern-normalize": "^3.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a3012a..2433744 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + '@astrojs/sitemap': + specifier: ^3.6.0 + version: 3.6.0 '@astrojs/solid-js': specifier: ^5.1.3 version: 5.1.3(@types/node@24.10.1)(solid-js@1.9.10) @@ -36,6 +39,9 @@ packages: resolution: {integrity: sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} + '@astrojs/sitemap@3.6.0': + resolution: {integrity: sha512-4aHkvcOZBWJigRmMIAJwRQXBS+ayoP5z40OklTXYXhUDhwusz+DyDl+nSshY6y9DvkVEavwNcFO8FD81iGhXjg==} + '@astrojs/solid-js@5.1.3': resolution: {integrity: sha512-KxfYt4y1d7BuSw6EsN1EaPoGYsIES7bEI6AtTbncuabRUUMZs+mOWOeOdmgnwVLj+jbNbhBjUZsqr77eUviZdw==} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} @@ -626,9 +632,15 @@ packages: '@types/nlcst@2.0.3': resolution: {integrity: sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==} + '@types/node@17.0.45': + resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + '@types/node@24.10.1': resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==} + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -659,6 +671,9 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} + arg@5.0.2: + resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} + argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1331,6 +1346,9 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + sax@1.4.3: + resolution: {integrity: sha512-yqYn1JhPczigF94DMS+shiDMjDowYO6y9+wB/4WgO0Y19jWYk0lQ4tuG5KI7kj4FTp1wxPj5IFfcrz/s1c3jjQ==} + semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -1360,6 +1378,11 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + sitemap@8.0.2: + resolution: {integrity: sha512-LwktpJcyZDoa0IL6KT++lQ53pbSrx2c9ge41/SeLTyqy2XUNA6uR4+P9u5IVo5lPeL2arAcOKn1aZAxoYbCKlQ==} + engines: {node: '>=14.0.0', npm: '>=6.0.0'} + hasBin: true + smol-toml@1.5.2: resolution: {integrity: sha512-QlaZEqcAH3/RtNyet1IPIYPsEWAaYyXXv1Krsi+1L/QHppjX4Ifm8MQsBISz9vE8cHicIq3clogsheili5vhaQ==} engines: {node: '>= 18'} @@ -1379,6 +1402,9 @@ packages: space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} + 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'} @@ -1713,6 +1739,12 @@ snapshots: dependencies: prismjs: 1.30.0 + '@astrojs/sitemap@3.6.0': + dependencies: + sitemap: 8.0.2 + stream-replace-string: 2.0.0 + zod: 3.25.76 + '@astrojs/solid-js@5.1.3(@types/node@24.10.1)(solid-js@1.9.10)': dependencies: solid-js: 1.9.10 @@ -2217,10 +2249,16 @@ snapshots: dependencies: '@types/unist': 3.0.3 + '@types/node@17.0.45': {} + '@types/node@24.10.1': dependencies: undici-types: 7.16.0 + '@types/sax@1.2.7': + dependencies: + '@types/node': 24.10.1 + '@types/unist@3.0.3': {} '@ungap/structured-clone@1.3.0': {} @@ -2242,6 +2280,8 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 + arg@5.0.2: {} + argparse@2.0.1: {} aria-query@5.3.2: {} @@ -3269,6 +3309,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.53.2 fsevents: 2.3.3 + sax@1.4.3: {} + semver@6.3.1: {} semver@7.7.3: {} @@ -3324,6 +3366,13 @@ snapshots: sisteransi@1.0.5: {} + sitemap@8.0.2: + dependencies: + '@types/node': 17.0.45 + '@types/sax': 1.2.7 + arg: 5.0.2 + sax: 1.4.3 + smol-toml@1.5.2: {} solid-js@1.9.10: @@ -3345,6 +3394,8 @@ snapshots: space-separated-tokens@2.0.2: {} + stream-replace-string@2.0.0: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 diff --git a/src/components/BaseFooter.astro b/src/components/BaseFooter.astro index c7fed48..f0fa4f4 100644 --- a/src/components/BaseFooter.astro +++ b/src/components/BaseFooter.astro @@ -7,7 +7,7 @@ .content { color: aliceblue; - width: var(--layout-width); + max-width: var(--layout-width); margin: 0 auto; color: #f9f8f6; display: flex; diff --git a/src/components/BaseHeader.astro b/src/components/BaseHeader.astro index ee3ae6d..198a5bd 100644 --- a/src/components/BaseHeader.astro +++ b/src/components/BaseHeader.astro @@ -8,7 +8,7 @@ } .main-nav { - width: var(--layout-width); + max-width: var(--layout-width); margin: 0 auto; height: 100%; padding: 0 16px; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 104acf8..357e812 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -12,14 +12,18 @@ const { siteTitle } = metadata;
- +