mirror of
https://github.com/SkyfallWasTaken/skyfalldev.git
synced 2024-12-04 14:53:39 +00:00
Add sitemap.xml, robots.txt
This commit is contained in:
parent
e94666e44e
commit
8cdaa9e69a
6 changed files with 25 additions and 4 deletions
|
@ -7,6 +7,7 @@ import svelte from "@astrojs/svelte";
|
|||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
// FIXME: don't hardcode this
|
||||
site: "https://skyfall.dev",
|
||||
integrations: [mdx(), sitemap(), tailwind(), svelte()],
|
||||
/* output: "hybrid", // or 'server'
|
||||
|
|
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -51,5 +51,8 @@ const { title, description, image = "/blog-placeholder-1.jpg" } = Astro.props;
|
|||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
||||
|
||||
<!-- Sitemap -->
|
||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||
|
||||
<!-- Transitions -->
|
||||
<ViewTransitions />
|
16
src/pages/robots.txt.ts
Normal file
16
src/pages/robots.txt.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import type { APIRoute } from "astro";
|
||||
|
||||
const robotsTxt = `
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: ${new URL("sitemap-index.xml", import.meta.env.SITE).href}
|
||||
`.trim();
|
||||
|
||||
export const GET: APIRoute = () => {
|
||||
return new Response(robotsTxt, {
|
||||
headers: {
|
||||
"Content-Type": "text/plain; charset=utf-8",
|
||||
},
|
||||
});
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
import { vitePreprocess } from '@astrojs/svelte';
|
||||
import { vitePreprocess } from "@astrojs/svelte";
|
||||
|
||||
export default {
|
||||
preprocess: vitePreprocess(),
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strict",
|
||||
"exclude": ["dist/**"],
|
||||
"compilerOptions": {
|
||||
"strictNullChecks": true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue