Skip to content

Commit

Permalink
feat(config): Add sitemap integration and update Astro config
Browse files Browse the repository at this point in the history
- Added `@astrojs/sitemap` as a dependency in `package.json`
- Updated `astro.config.mjs` to include the `integrations` property with the value of `[sitemap()]`
- Added `<link rel="sitemap" href={base + "sitemap-index.xml"} />` in `BaseHead.astro`

These changes enable sitemap generation for the website and improve SEO.
  • Loading branch information
SakuraIsayeki committed Jun 23, 2024
1 parent bac616d commit 64b9afc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 4 deletions.
10 changes: 6 additions & 4 deletions nodsoft_moltenobsidian_web/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { defineConfig } from 'astro/config';
import sitemap from "@astrojs/sitemap";

// https://astro.build/config
export default defineConfig({
site: 'https://moltenobsidian.dev',
base: '/',
output: 'static'
});
site: 'https://moltenobsidian.dev',
base: '/',
output: 'static',
integrations: [sitemap()]
});
1 change: 1 addition & 0 deletions nodsoft_moltenobsidian_web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/sitemap": "^3.1.6",
"astro": "^4.11.0",
"bootstrap-icons": "^1.11.3",
"moltenobsidian-ssg-client": "link:..\\nodsoft_moltenobsidian_ssg_client",
Expand Down
44 changes: 44 additions & 0 deletions nodsoft_moltenobsidian_web/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nodsoft_moltenobsidian_web/src/components/BaseHead.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const base = import.meta.env.BASE_URL ?? "/";
<link rel="icon" type="image/png" sizes="32x32" href={base + "favicon-32x32.png"} />
<link rel="icon" type="image/png" sizes="16x16" href={base + "favicon-16x16.png"} />
<link rel="manifest" href={base + "site.webmanifest"} />
<link rel="sitemap" href={base + "sitemap-index.xml"} />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<meta name="generator" content={Astro.generator} />
Expand Down

0 comments on commit 64b9afc

Please sign in to comment.