-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #188 from oystersjp/feature/v2-sitemap
[oysters.dev v2] sitemapの追加
- Loading branch information
Showing
5 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import { defineConfig } from 'astro/config' | ||
import tailwind from '@astrojs/tailwind' | ||
|
||
import sitemap from '@astrojs/sitemap' | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: 'https://oysters.dev', | ||
integrations: [tailwind()] | ||
integrations: [ | ||
tailwind(), | ||
sitemap({ | ||
customPages: ['https://oysters.dev/podcast'] | ||
}) | ||
] | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { APIRoute } from 'astro' | ||
|
||
const getRobotsTxt = (sitemapURL: URL) => ` | ||
User-agent: * | ||
Allow: / | ||
Sitemap: ${sitemapURL.href} | ||
` | ||
|
||
export const GET: APIRoute = ({ site }) => { | ||
const sitemapURL = new URL('sitemap-index.xml', site) | ||
return new Response(getRobotsTxt(sitemapURL)) | ||
} |
7f606fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Deployed on https://66c1a11b832d573484f48abf--zealous-yalow-0137bf.netlify.app