-
-
Couldn't load subscription status.
- Fork 643
fix: add transliteration module to support non-latin URLs #423
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
Open
marharyta
wants to merge
1
commit into
NotionX:master
from
marharyta:fix/getCanonicalPageId-does-not-support-non-latin-page-titles
Open
fix: add transliteration module to support non-latin URLs #423
marharyta
wants to merge
1
commit into
NotionX:master
from
marharyta:fix/getCanonicalPageId-does-not-support-non-latin-page-titles
Conversation
This file contains hidden or 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
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: getCanonicalPageId does not support non-latin page titles
Issue:
I am using [Notion.so](http://Notion.so) to run [FinUA.org](http://FinUA.org) website and currently it isb deployed with [super.so](http://super.so). I have been using nextjs-notion-starter-kit project for it (thank you).
As deployed the project to Vercel, I realized that there were quite a few browser warnings about the page due to generated page URLs (they looked broken).
Screenshot 2023年01月21日 at 18 41 25
the page behind it:
Screenshot 2023年01月21日 at 18 41 37
moreover, this page also had the same URL generated
/-despite being a separate page, and clicking on it would lead to the first page.Screenshot 2023年01月21日 at 18 42 13
I have investigated it, and it seems that the problem was in the module https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/main/lib/get-canonical-page-id.ts
I went to the module https://github.com/NotionX/react-notion-x/tree/master/packages/notion-utils
and copied https://github.com/NotionX/react-notion-x/blob/master/packages/notion-utils/src/get-canonical-page-id.ts module, the problem seemed to be
getCanonicalPageIdfunction, it only seemed to work for Latin symbolsnormalizeTitle(getBlockTitle(block, recordMap)):I pulled the
normalizeTitlefunction, and yes, it seems to be the caseSolution:
The one that worked for me was just replacing
normalizeTitle(getBlockTitle(block, recordMap))withslugifyfrom the transliteration npm package.Notion Test Page ID
701245d6db8c413689d180e87269ee56