Skip to content

Commit dc2501a

Browse files
committed
feat: added robots.txt and sitemap
1 parent 7f4db2b commit dc2501a

File tree

6 files changed

+90
-30
lines changed

6 files changed

+90
-30
lines changed

astro.config.mjs

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
import { defineConfig } from 'astro/config';
22
import tailwind from "@astrojs/tailwind";
33
import react from "@astrojs/react";
4-
54
import icon from "astro-icon";
65

6+
import sitemap from "@astrojs/sitemap";
7+
import { site } from './src/constants/site';
8+
79
// https://astro.build/config
810
export default defineConfig({
11+
site,
912
integrations: [tailwind(), react(), icon({
10-
svgoOptions: {
11-
multipass: true,
12-
plugins: [
13-
'preset-default',
14-
// Avoid collisions with ids in other SVGs,
15-
// which was causing incorrect gradient directions
16-
// https://github.com/svg/svgo/issues/1746#issuecomment-1803600573
17-
//
18-
// Previously, this was a problem where unique ids
19-
// could not be generated since svgo@3
20-
// https://github.com/svg/svgo/issues/674
21-
// https://github.com/svg/svgo/issues/1746
22-
'cleanupIds',
23-
{
24-
name: 'prefixIds',
25-
params: {
26-
prefix() {
27-
svgCount++;
28-
return `svgid-${svgCount}`;
29-
}
30-
}
31-
}
32-
]
33-
},
34-
include: {
35-
tabler: ['*']
36-
}
37-
})],
13+
svgoOptions: {
14+
multipass: true,
15+
plugins: ['preset-default',
16+
// Avoid collisions with ids in other SVGs,
17+
// which was causing incorrect gradient directions
18+
// https://github.com/svg/svgo/issues/1746#issuecomment-1803600573
19+
//
20+
// Previously, this was a problem where unique ids
21+
// could not be generated since svgo@3
22+
// https://github.com/svg/svgo/issues/674
23+
// https://github.com/svg/svgo/issues/1746
24+
'cleanupIds', {
25+
name: 'prefixIds',
26+
params: {
27+
prefix() {
28+
svgCount++;
29+
return `svgid-${svgCount}`;
30+
}
31+
}
32+
}]
33+
},
34+
include: {
35+
tabler: ['*']
36+
}
37+
}), sitemap()]
3838
});

package-lock.json

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"dependencies": {
1414
"@astrojs/check": "^0.9.2",
1515
"@astrojs/react": "^3.6.2",
16+
"@astrojs/sitemap": "^3.1.6",
1617
"@astrojs/tailwind": "^5.1.0",
1718
"@iconify-json/tabler": "^1.1.116",
1819
"@react-three/drei": "^9.109.5",
@@ -35,4 +36,4 @@
3536
"three-globe": "^2.31.1",
3637
"typescript": "^5.5.4"
3738
}
38-
}
39+
}

public/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://rubenbupe.com/sitemap-index.xml

src/constants/site.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export const site = 'https://rubenbupe.com';
2+
13
export const siteName = 'Rubén Buzón';
24
export const siteDescription = 'Rubén Buzón - Full Stack Engineer';
35

src/layouts/Layout.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const { title } = Astro.props;
1717
<meta charset="UTF-8" />
1818
<meta name="description" content={siteDescription} />
1919
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
20+
<link rel="sitemap" href="/sitemap-index.xml" />
2021

2122
<link
2223
rel="apple-touch-icon"

0 commit comments

Comments
 (0)