Skip to content

Prevent header title changing to page title? #3813

Answered by mfncooper
StarfallProjects asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@StarfallProjects
Comment options

Comment options

You must be logged in to vote
5 replies
@rodrigoalcarazdelaosa
Comment options

@squidfunk
Comment options

@rodrigoalcarazdelaosa
Comment options

@squidfunk
Comment options

@rodrigoalcarazdelaosa
Comment options

Answer selected by squidfunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants