Skip to content

Commit

Permalink
feat: add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlatz committed Jan 19, 2025
1 parent bd0fe5a commit d9f804f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
20 changes: 17 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import config from "./src/config/config.json";
import umami from "@yeskunall/astro-umami";

export default defineConfig({
site: config.site.base_url ? config.site.base_url : "http://examplesite.com",
base: config.site.base_path ? config.site.base_path : "/",
site: "https://blog.biblys.org/",
base: "/",
trailingSlash: config.site.trailing_slash ? "always" : "never",
image: {},
integrations: [
Expand All @@ -34,7 +34,21 @@ export default defineConfig({
],
}),
mdx(),
umami({id :'984d1210-a376-4349-aa2f-83fab030a249' })
umami({id :'984d1210-a376-4349-aa2f-83fab030a249' }),
sitemap({
filter: (page) => page !== 'https://blog.biblys.org/preview',
changefreq: 'monthly',
priority: 0.7,
serialize(item) {
if (item.url === 'https://blog.biblys.org/') {
item.changefreq = 'weekly';
item.lastmod = new Date().toISOString();
item.priority = 1;
}
return item;
},
}),

],
markdown: {
remarkPlugins: [
Expand Down
4 changes: 3 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
User-agent: *
Allow: /

Disallow: /api/*
Disallow: /api/*

Sitemap: https://blog.biblys.org/sitemap-index.xml
2 changes: 2 additions & 0 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const pageTitle = titleFromProps ? `${titleFromProps} · ${config.site.title}` :
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
<link rel="manifest" href="/favicon/site.webmanifest" />

<link rel="sitemap" href="/sitemap-index.xml" />

<!-- theme meta -->
<meta name="theme-name" content="bookworm-light-astro" />
<meta name="msapplication-TileColor" content="#000000" />
Expand Down

0 comments on commit d9f804f

Please sign in to comment.