-
-
Notifications
You must be signed in to change notification settings - Fork 120
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 #591 from iamvishnusankar/exp/app-dir-server-sitemap
[Feat] AppDir Support
- Loading branch information
Showing
36 changed files
with
2,531 additions
and
2,085 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 3.1$(rev:.r) | ||
name: 4.0$(rev:.r) | ||
trigger: | ||
branches: | ||
include: | ||
|
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,15 @@ | ||
## 4.0.x | ||
|
||
v4.0.x added support for next13.2+ `appDir` via [Custom Route Handlers](https://nextjs.org/blog/next-13-2#custom-route-handlers) | ||
|
||
#### API Changes | ||
|
||
Generating dynamic/server-side sitemaps | ||
|
||
- `getServerSideSitemapIndex`: Generates index sitemaps based on urls provided and returns application/xml response. Supports next13+ route.{ts,js} file. | ||
|
||
- To continue using inside pages directory, import `getServerSideSitemapIndexLegacy` instead. | ||
|
||
- `getServerSideSitemap`: Generates sitemap based on field entires and returns application/xml response. Supports next13+ route.{ts,js} file. | ||
|
||
- To continue using inside pages directory, import `getServerSideSitemapLegacy` instead. |
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
12 changes: 12 additions & 0 deletions
12
examples/app-dir/app/(sitemaps)/server-sitemap-index.xml/route.ts
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,12 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { getServerSideSitemapIndex } from 'next-sitemap' | ||
|
||
export async function GET(request: Request) { | ||
// Method to source urls from cms | ||
// const urls = await fetch('https//example.com/api') | ||
|
||
return getServerSideSitemapIndex([ | ||
'https://example.com/path-1.xml', | ||
'https://example.com/path-2.xml', | ||
]) | ||
} |
22 changes: 22 additions & 0 deletions
22
examples/app-dir/app/(sitemaps)/server-sitemap.xml/route.ts
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,22 @@ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
import { getServerSideSitemap } from 'next-sitemap' | ||
|
||
export async function GET(request: Request) { | ||
// Method to source urls from cms | ||
// const urls = await fetch('https//example.com/api') | ||
|
||
return getServerSideSitemap([ | ||
{ | ||
loc: 'https://example.com', | ||
lastmod: new Date().toISOString(), | ||
// changefreq | ||
// priority | ||
}, | ||
{ | ||
loc: 'https://example.com/dynamic-path-2', | ||
lastmod: new Date().toISOString(), | ||
// changefreq | ||
// priority | ||
}, | ||
]) | ||
} |
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
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
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
4 changes: 2 additions & 2 deletions
4
examples/custom-config-file/pages/server-sitemap-index.xml/index.tsx
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
4 changes: 2 additions & 2 deletions
4
examples/custom-config-file/pages/server-sitemap.xml/index.tsx
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
Oops, something went wrong.