https://github.com/innei/nextjs-metadata-url-encode-reproduction
https://github.com/innei/nextjs-metadata-url-encode-reproduction
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/innei/nextjs-metadata-url-encode-reproduction
- Owner: Innei
- Created: 2023-07-12T15:56:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-25T09:05:05.000Z (over 2 years ago)
- Last Synced: 2025-02-03T23:49:04.257Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://nextjs-metadata-url-encode-reproduction.vercel.app
- Size: 5.07 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Next.js metadata url will encodeURLComponent unexpectedly.
```ts
export const generateMetadata = async (): Promise => {
const ogUrl = new URL('http://localhost:3000/og.png')
ogUrl.searchParams.set('title', 'Nextjs')
ogUrl.searchParams.set('description', 'description - Nextjs')
return {
title: 'Nextjs',
openGraph: {
images: ogUrl,
},
}
}
```
and generate the code of `` tag.
```
```
The `&` will encode to `&` unexpected.