-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[meta-tags] 앱라우터용 메타태그 및 QaPageScript, DiscussionForumPostingScript를 추가합니다. #3500
Conversation
release-canary |
v14.0.7-pr-3500.7 has been published! |
release-canary |
v14.0.7-pr-3500.9 has been published! |
release-canary |
v14.0.7-pr-3500.10 has been published! |
const articleScript = createScript(props, 'Article') | ||
|
||
return ( | ||
<Script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 기존 코드에서 head 태그 제거(nextjs 앱라우터는 head 태그를 지원하지 않습니다)
- 일반 script 태그를 next/script 태그로 변경
- 간혹 파싱 오류가 있어 dangerouslySetInnerHtml로 주입합니다. (관련 스레드)
@@ -58,22 +61,23 @@ function addSchemaType<T extends object>(originObj: T): T { | |||
return mergeObj({ '@type': value }, obj) | |||
} | |||
|
|||
if (key in SCHEMA_TYPE_MAP) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 조건문에 걸려 의도한대로 재귀가 돌고 있지 않았습니다. 해당 조건문을 key값을 확인하는 곳으로 옮겼습니다.
titleFromProps || process.env.NEXT_PUBLIC_DEFAULT_PAGE_TITLE || undefined | ||
const description = | ||
descriptionFromProps || | ||
process.env.NEXT_PUBLIC_DEFAULT_PAGE_DESCRIPTION || | ||
undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 title과 description 모두 || undefined
는 없어도 되지 않나요?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e09119e 여기서 제거했습니다!
🙇♂️ |
PR 설명
nextjs 앱라우터용 메타태그 및 QaPageScript, DiscussionForumPostingScript를 추가합니다.
변경 내역