mirror of
https://github.com/d0zingcat/nextjs-notion-starter-kit.git
synced 2026-05-22 23:16:44 +00:00
feat: update robots.txt to also be auto-generated
This commit is contained in:
14
pages/robots.txt.tsx
Normal file
14
pages/robots.txt.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react'
|
||||
|
||||
import { host } from 'lib/config'
|
||||
|
||||
export default class Robots extends React.Component {
|
||||
static async getInitialProps({ res }) {
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
res.write(`User-agent: *
|
||||
Allow: /
|
||||
Sitemap: ${host}/sitemap.xml
|
||||
`)
|
||||
res.end()
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
Reference in New Issue
Block a user