-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix: sync the page title regarding the title config #2478
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hmm, I see yeah it is inconsistent depending how you land on the page. Clicking on your link, the title is Also I think that it would be better for the title to be |
c6337f6
to
a812714
Compare
Yea, It makes sense that we could concat the update. |
a812714
to
af44f81
Compare
af44f81
to
19a0678
Compare
19a0678
to
ddaadff
Compare
Summary
Currently, on the v5 changes, each headings/links on the sidebar has the
title
via#addTextAsTitleAttribute
.docsify/src/core/render/index.js
Line 20 in 42f2548
After the
event
refactor, the pagetitle
update function changed, especially the search page title.Example from our site.
v4:
On the main content load the page title such as
Configuration
, no matter you switch the sections toConfiguration
.or directly jump to its sub headings configuration?id=alias.
v5 as-is:
⚠️ directly jump to its sub headings configuration?id=alias via the URL,it will update the page title to
⚠️ On the search function, when clicks the search result, it comes to the mess innerText as page title instead.
On the main content load the page title such as
Configuration
, switch the sections toConfiguration
. (same to v4 )sub title
(alias
) instead.The behavior for the sidebar headings for main content, I think it makes sense to indicate the specific target and respect the title.
So, I fix the search problem via a consistent way that all retrieve page title from to the
title
attribute also.Now, it will use the
${name} - ${title}
as the page title, if no name config, use title directly.Related issue, if any:
What kind of change does this PR introduce?
Bugfix
For any code change,
Does this PR introduce a breaking change?
Yes
No
No
Tested in the following browsers: