-
Notifications
You must be signed in to change notification settings - Fork 516
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
enhance(macros/PreviousMenuNext): use the actual title of the document by default #10812
Conversation
/cc @awxiaoxian2020 You may be interested in this :) |
95618e1
to
d24c2ff
Compare
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.
Very nice, adds functionality and cleans up some code, a few small queries:
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.
Thanks for those answers, looks good with no changes!
Summary
Fixes: #10274
Problem
We used to use localized slugs, so we could generate localized titles through the slugs. But now we have used unified slugs across locales, which causes the
{{PreviousMenuNext}}
macro to be unable to display localized titles for the menu link.Solution
Solve this problem by retrieving the title of the page, if the page is not found:
en-US
), if still not existed, fallback to generate it from the given slug.Screenshots
PreviousMenu macro
{{PreviousMenu}}
macro reuses the{{PreviousMenuNext}}
macro.How did you test this change?
Run
yarn dev
and check the above pages.