Skip to content

Commit

Permalink
Add sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed Sep 10, 2023
1 parent 5bb39cd commit 60409b1
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 6 deletions.
12 changes: 9 additions & 3 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { defineConfig } from 'astro/config';
import tailwind from "@astrojs/tailwind";

import mdx from "@astrojs/mdx";

import sitemap from "@astrojs/sitemap";

// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), mdx()]
});
site: 'https://nixos.org',
integrations: [
tailwind(),
mdx(),
sitemap(),
],
});
46 changes: 46 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@astrojs/mdx": "^1.0.3",
"@astrojs/sitemap": "^3.0.0",
"@astrojs/tailwind": "^5.0.0",
"astro": "^3.0.12",
"tailwindcss": "^3.3.3"
Expand Down
4 changes: 4 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://nixos.org/sitemap-index.xml
2 changes: 2 additions & 0 deletions src/layouts/Main.astro → src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const { title } = Astro.props
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />

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

<title>{title}</title>
</head>
<body>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
import MainLayout from '../layouts/Main.astro';
import Layout from '../layouts/Layout.astro';
---

<MainLayout title="WORKS">
<Layout title="WORKS">
<h1 class="text-blue-600">WORKS!!!</h1>
</MainLayout>
</Layout>

0 comments on commit 60409b1

Please sign in to comment.