Skip to content

Commit

Permalink
chore: refactor with-next-sitemap example (#40712)
Browse files Browse the repository at this point in the history
## 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)
  • Loading branch information
HaNdTriX committed Sep 20, 2022
1 parent 499ce6d commit c2f48ea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions examples/with-next-sitemap/.gitignore
Expand Up @@ -34,3 +34,8 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# next sitemap build
public/robots.txt
public/sitemap.xml
public/sitemap-*.xml
@@ -1,3 +1,4 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: 'https://example.com',
generateRobotsTxt: true,
Expand Down
12 changes: 6 additions & 6 deletions examples/with-next-sitemap/package.json
Expand Up @@ -8,13 +8,13 @@
},
"dependencies": {
"next": "latest",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "14.6.0",
"@types/react": "^16.9.45",
"next-sitemap": "latest",
"typescript": "^4.3.2"
"@types/node": "18.7.18",
"@types/react": "^18.0.20",
"next-sitemap": "3.1.22",
"typescript": "^4.8.3"
}
}
5 changes: 2 additions & 3 deletions examples/with-next-sitemap/pages/[dynamic].tsx
Expand Up @@ -3,12 +3,11 @@ import { useRouter } from 'next/router'

const DynamicPage = () => {
const { query } = useRouter()

return (
<div>
<>
<h1>Dynamic Page</h1>
<h2>Query: {query.dynamic}</h2>
</div>
</>
)
}

Expand Down
8 changes: 4 additions & 4 deletions examples/with-next-sitemap/pages/index.tsx
@@ -1,7 +1,7 @@
import Link from 'next/link'

const HelloWorld = () => (
<div>
const IndexPage = () => (
<>
<h1>Hello World Page</h1>
<ol>
<li>
Expand Down Expand Up @@ -30,7 +30,7 @@ const HelloWorld = () => (
</Link>
</li>
</ol>
</div>
</>
)

export default HelloWorld
export default IndexPage
3 changes: 2 additions & 1 deletion examples/with-next-sitemap/tsconfig.json
Expand Up @@ -12,7 +12,8 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit c2f48ea

Please sign in to comment.