mirror of
https://github.com/SkyfallWasTaken/skyfalldev.git
synced 2024-11-10 04:09:38 +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
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
// FIXME: don't hardcode this
|
||||||
site: "https://skyfall.dev",
|
site: "https://skyfall.dev",
|
||||||
integrations: [mdx(), sitemap(), tailwind(), svelte()],
|
integrations: [mdx(), sitemap(), tailwind(), svelte()],
|
||||||
/* output: "hybrid", // or 'server'
|
/* 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:description" content={description} />
|
||||||
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
||||||
|
|
||||||
|
<!-- Sitemap -->
|
||||||
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||||
|
|
||||||
<!-- Transitions -->
|
<!-- Transitions -->
|
||||||
<ViewTransitions />
|
<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 {
|
export default {
|
||||||
preprocess: vitePreprocess(),
|
preprocess: vitePreprocess(),
|
||||||
}
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"extends": "astro/tsconfigs/strict",
|
"extends": "astro/tsconfigs/strict",
|
||||||
|
"exclude": ["dist/**"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"strictNullChecks": true
|
"strictNullChecks": true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue