Skip to content

Commit

Permalink
feat: add sitemap.xml redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Sep 1, 2023
1 parent 30dbeb4 commit f18ec28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
9 changes: 9 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ let nextConfig = {
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
},

async rewrites() {
return {
beforeFiles: [
{ source: '/atom.xml', destination: '/feed' },
{ source: '/sitemap.xml', destination: '/sitemap' },
],
}
},

webpack: (config, options) => {
config.externals.push({
'utf-8-validate': 'commonjs utf-8-validate',
Expand Down
1 change: 0 additions & 1 deletion src/app/feed/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { escapeXml } from '~/lib/helper.server'
import { getQueryClient } from '~/lib/query-client.server'
import { apiClient } from '~/lib/request'

export const runtime = 'edge'
export const revalidate = 60 * 60 // 1 hour

export async function GET() {
Expand Down
1 change: 0 additions & 1 deletion src/app/sitemap/route.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getQueryClient } from '~/lib/query-client.server'
import { apiClient } from '~/lib/request'

export const runtime = 'edge'
export const revalidate = 60 * 60 // 1 hour

export const GET = async () => {
Expand Down

0 comments on commit f18ec28

Please sign in to comment.