Unverified Commit c2f48ea8 authored by Henrik Wenz's avatar Henrik Wenz Committed by GitHub

chore: refactor with-next-sitemap example (#40712)

## Changes

see commits

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
parent 499ce6db
...@@ -34,3 +34,8 @@ yarn-error.log* ...@@ -34,3 +34,8 @@ yarn-error.log*
# typescript # typescript
*.tsbuildinfo *.tsbuildinfo
next-env.d.ts next-env.d.ts
# next sitemap build
public/robots.txt
public/sitemap.xml
public/sitemap-*.xml
\ No newline at end of file
/** @type {import('next-sitemap').IConfig} */
module.exports = { module.exports = {
siteUrl: 'https://example.com', siteUrl: 'https://example.com',
generateRobotsTxt: true, generateRobotsTxt: true,
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
}, },
"dependencies": { "dependencies": {
"next": "latest", "next": "latest",
"react": "^17.0.2", "react": "^18.2.0",
"react-dom": "^17.0.2" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "14.6.0", "@types/node": "18.7.18",
"@types/react": "^16.9.45", "@types/react": "^18.0.20",
"next-sitemap": "latest", "next-sitemap": "3.1.22",
"typescript": "^4.3.2" "typescript": "^4.8.3"
} }
} }
...@@ -3,12 +3,11 @@ import { useRouter } from 'next/router' ...@@ -3,12 +3,11 @@ import { useRouter } from 'next/router'
const DynamicPage = () => { const DynamicPage = () => {
const { query } = useRouter() const { query } = useRouter()
return ( return (
<div> <>
<h1>Dynamic Page</h1> <h1>Dynamic Page</h1>
<h2>Query: {query.dynamic}</h2> <h2>Query: {query.dynamic}</h2>
</div> </>
) )
} }
......
import Link from 'next/link' import Link from 'next/link'
const HelloWorld = () => ( const IndexPage = () => (
<div> <>
<h1>Hello World Page</h1> <h1>Hello World Page</h1>
<ol> <ol>
<li> <li>
...@@ -30,7 +30,7 @@ const HelloWorld = () => ( ...@@ -30,7 +30,7 @@ const HelloWorld = () => (
</Link> </Link>
</li> </li>
</ol> </ol>
</div> </>
) )
export default HelloWorld export default IndexPage
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve" "jsx": "preserve",
"incremental": true
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment