Prevent header title changing to page title? #3813
-
Hi! At present, the main title in the header changes to the page title on scroll. Is it possible to disable this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
There's no feature flag, but you can override mkdocs-material/src/partials/header.html Lines 60 to 67 in 55a58da |
Beta Was this translation helpful? Give feedback.
-
I know I'm late to the party, but ... While the solution from @squidfunk does prevent the page title from replacing the site title, it causes the site title to go blank, rather than leaving it unchanged. For me, what @StarfallProjects used causes the site title to be replaced with the site title again but with a slightly different styling, so there's still a subtle change. It turns out that simply removing the https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/partials/header.html#L56 Hope that helps someone else digging for a solution. |
Beta Was this translation helpful? Give feedback.
I know I'm late to the party, but ...
While the solution from @squidfunk does prevent the page title from replacing the site title, it causes the site title to go blank, rather than leaving it unchanged. For me, what @StarfallProjects used causes the site title to be replaced with the site title again but with a slightly different styling, so there's still a subtle change.
It turns out that simply removing the
data-md-component
attribute from this line does the right thing and prevents the site title from being replaced at all:https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/partials/header.html#L56
Hope that helps someone else digging for a solution.