Skip to content

Commit 00ae879

Browse files
committed
Update: SEO
1 parent 38ff907 commit 00ae879

File tree

8 files changed

+212
-39
lines changed

8 files changed

+212
-39
lines changed

astro.config.mjs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
import { defineConfig } from "astro/config";
22
import react from "@astrojs/react";
33
import tailwind from "@astrojs/tailwind";
4+
import sitemap from "@astrojs/sitemap";
45

56
export default defineConfig({
7+
site: 'https://www.codextreme.me',
68
i18n: {
79
defaultLocale: "en",
810
locales: ["es", "en"],
911
routing: {
1012
prefixDefaultLocale: false,
1113
},
1214
},
13-
1415
output: "static",
15-
integrations: [tailwind(), react()],
16+
integrations: [
17+
tailwind(),
18+
react(),
19+
sitemap({
20+
i18n: {
21+
defaultLocale: 'en',
22+
locales: {
23+
en: 'en',
24+
es: 'es',
25+
},
26+
},
27+
})
28+
],
1629
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"dependencies": {
1919
"@astrojs/react": "^4.3.0",
20+
"@astrojs/sitemap": "^3.4.1",
2021
"@heroicons/react": "^2.2.0",
2122
"@nanostores/react": "^1.0.0",
2223
"@types/react": "^19.1.8",

pnpm-lock.yaml

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

public/robots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
User-agent: *
2+
Allow: /
3+
4+
# Sitemap
5+
Sitemap: https://www.codextreme.me/sitemap.xml
6+
7+
# Disallow admin or private areas if any
8+
# Disallow: /admin/

src/components/Breadcrumbs.astro

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
interface BreadcrumbItem {
3+
name: string;
4+
url: string;
5+
}
6+
7+
interface Props {
8+
items: BreadcrumbItem[];
9+
}
10+
11+
const { items } = Astro.props;
12+
---
13+
14+
<nav aria-label="Breadcrumb">
15+
<ol class="flex space-x-2 text-sm text-gray-600 dark:text-gray-400">
16+
{items.map((item, index) => (
17+
<li class="flex items-center">
18+
{index > 0 && <span class="mx-2">/</span>}
19+
{index === items.length - 1 ? (
20+
<span class="font-medium text-gray-900 dark:text-gray-100">{item.name}</span>
21+
) : (
22+
<a href={item.url} class="hover:text-blue-600 transition-colors">{item.name}</a>
23+
)}
24+
</li>
25+
))}
26+
</ol>
27+
</nav>
28+
29+
<!-- Schema.org Breadcrumb -->
30+
<script type="application/ld+json">
31+
{
32+
"@context": "https://schema.org",
33+
"@type": "BreadcrumbList",
34+
"itemListElement": [
35+
{items.map((item, index) => `{
36+
"@type": "ListItem",
37+
"position": ${index + 1},
38+
"name": "${item.name}",
39+
"item": "https://www.codextreme.me${item.url}"
40+
}`).join(',\n ')}
41+
]
42+
}
43+
</script>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
interface Props {
3+
software: {
4+
name: string;
5+
description: string;
6+
downloadUrl: string;
7+
version?: string;
8+
};
9+
}
10+
11+
const { software } = Astro.props;
12+
---
13+
14+
<script type="application/ld+json">
15+
{
16+
"@context": "https://schema.org",
17+
"@type": "SoftwareApplication",
18+
"name": "{software.name}",
19+
"description": "{software.description}",
20+
"downloadUrl": "{software.downloadUrl}",
21+
"operatingSystem": "Windows",
22+
"applicationCategory": "UtilitiesApplication"
23+
}
24+
</script>

src/layouts/BaseLayout.astro

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,27 @@
22
import "@/styles/tailwind.css";
33
import Header from "@/components/Header.astro";
44
import Footer from "@/components/Footer.astro";
5-
65
import { languageList } from "@/i18n/ui";
76
7+
interface Props {
8+
title?: string;
9+
description?: string;
10+
keywords?: string;
11+
ogImage?: string;
12+
canonical?: string;
13+
}
14+
15+
const {
16+
title = "CodeXtremeOS: Windows Optimizado para Gaming | Mejora FPS y Rendimiento",
17+
description = "Descarga CodeXtremeOS, la mejor versión de Windows optimizada para gaming y máximo rendimiento. Eleva tu experiencia de juego a otro nivel.",
18+
keywords = "Windows optimizado, gaming, rendimiento, CodeXtremeOS, sistema operativo para gamers, PC gaming, optimización Windows",
19+
ogImage = "https://www.codextreme.me/imagen-previa.png",
20+
canonical
21+
} = Astro.props;
22+
823
const currentLang = Astro.currentLocale || "en";
9-
currentLang as keyof typeof languageList;
24+
const currentUrl = new URL(Astro.request.url);
25+
const canonicalUrl = canonical || currentUrl.href;
1026
---
1127

1228
<!doctype html>
@@ -15,46 +31,34 @@ currentLang as keyof typeof languageList;
1531
<meta charset="UTF-8" />
1632
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1733

18-
<!-- Título SEO -->
19-
<title>CodeXtreme - Windows Gaming</title>
34+
<!-- Canonical URL -->
35+
<link rel="canonical" href={canonicalUrl} />
2036

21-
<!-- Meta Tags SEO -->
22-
<meta
23-
name="description"
24-
content="Descarga CodeXtremeOS, la mejor versión de Windows optimizada para gaming y máximo rendimiento. Eleva tu experiencia de juego a otro nivel."
25-
/>
37+
<!-- Título SEO dinámico -->
38+
<title>{title}</title>
39+
40+
<!-- Meta Tags SEO dinámicos -->
41+
<meta name="description" content={description} />
42+
<meta name="keywords" content={keywords} />
2643
<meta name="robots" content="index, follow" />
27-
<meta
28-
name="keywords"
29-
content="Windows optimizado, gaming, rendimiento, CodeXtremeOS, sistema operativo para gamers, PC gaming, optimización Windows"
30-
/>
3144

32-
<!-- Open Graph y Twitter -->
45+
<!-- Open Graph dinámico -->
3346
<meta property="og:type" content="website" />
34-
<meta property="og:title" content="CodeXtremeOS" />
35-
<meta
36-
property="og:description"
37-
content="La mejor versión de Windows modificada para gaming y máximo rendimiento. Descarga CodeXtremeOS ahora y lleva tu experiencia de juego al siguiente nivel."
38-
/>
39-
<meta
40-
property="og:image"
41-
content="https://www.codextreme.me/imagen-previa.png"
42-
/>
43-
<meta property="og:url" content="https://www.codextreme.me/" />
47+
<meta property="og:title" content={title} />
48+
<meta property="og:description" content={description} />
49+
<meta property="og:image" content={ogImage} />
50+
<meta property="og:url" content={canonicalUrl} />
51+
52+
<!-- Twitter Cards dinámico -->
4453
<meta name="twitter:card" content="summary_large_image" />
45-
<meta name="twitter:title" content="CodeXtremeOS" />
46-
<meta
47-
name="twitter:description"
48-
content="La mejor versión de Windows modificada para gaming y máximo rendimiento. Descarga CodeXtremeOS ahora y lleva tu experiencia de juego al siguiente nivel."
49-
/>
50-
<meta
51-
name="twitter:image"
52-
content="https://www.codextreme.me/imagen-twitter.png"
53-
/>
54-
<meta
55-
name="google-site-verification"
56-
content="X4pVBsZ9Qujczrzm_M8EeRE0Kvom53DCD6zt2ffWXsI"
57-
/>
54+
<meta name="twitter:title" content={title} />
55+
<meta name="twitter:description" content={description} />
56+
<meta name="twitter:image" content={ogImage} />
57+
58+
<!-- Hreflang para idiomas -->
59+
<link rel="alternate" hreflang="es" href={`https://www.codextreme.me/es${Astro.url.pathname}`} />
60+
<link rel="alternate" hreflang="en" href={`https://www.codextreme.me${Astro.url.pathname}`} />
61+
<link rel="alternate" hreflang="x-default" href={`https://www.codextreme.me${Astro.url.pathname}`} />
5862

5963
<!-- Favicon y iconos -->
6064
<link rel="icon" href="/favicon.webp" sizes="32x32" />

src/pages/sitemap.xml.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { APIRoute } from 'astro';
2+
3+
const pages = [
4+
'',
5+
'/software',
6+
'/descargas',
7+
'/guias',
8+
'/herramientas',
9+
'/es',
10+
'/es/software',
11+
'/es/descargas',
12+
'/es/guias',
13+
'/es/herramientas'
14+
];
15+
16+
const baseUrl = 'https://www.codextreme.me';
17+
18+
export const GET: APIRoute = () => {
19+
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
20+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
21+
${pages.map(page => ` <url>
22+
<loc>${baseUrl}${page}</loc>
23+
<lastmod>${new Date().toISOString().split('T')[0]}</lastmod>
24+
<changefreq>weekly</changefreq>
25+
<priority>${page === '' ? '1.0' : '0.8'}</priority>
26+
</url>`).join('\n')}
27+
</urlset>`;
28+
29+
return new Response(sitemap, {
30+
headers: {
31+
'Content-Type': 'application/xml'
32+
}
33+
});
34+
};

0 commit comments

Comments
 (0)