docsify icon indicating copy to clipboard operation
docsify copied to clipboard

Alternative Page Title Generator [v5-rc]

Open BrysonC opened this issue 4 months ago • 2 comments

Problem or Desire

Since the name configuration can "also contain custom HTML for easier customization" (due to its primary/first use in the sidebar) using the name for page title generation can produce some ugly results. (In relation to #2478)

Proposal

A. Allow for the definition of a title generator (pageTitleFormatter) as recommended by @Koooooo-7 in #2478 B. Keep the new use of name for title generation, but create a new configuration (sidebar) that could be used to modify the sidebar directly.

Implementation Details

No response

Additional Context

Image

BrysonC avatar Oct 16 '25 17:10 BrysonC

Thank you for your feedback. I believe this is currently a bug, and I have submitted a pull request to fix it.

You can use hook.doneEach to modify the title, so we are not currently providing a pageTitleFormatter.

sy-records avatar Oct 17 '25 03:10 sy-records

hook.doneEach does not seem to work, I see the intended page title flash briefly before it reverts back to the html goop, does that mean I need to use hook.ready instead?

This seems like a hacky work around, is there consideration for new configuration (like sidebar) that could be used to support HTML? It just seems odd that your configuration page boasts "the name field can also contain custom HTML for easier customization", but it will now come with the downside of a weird page title (unless using this weird trick).

BrysonC avatar Nov 03 '25 01:11 BrysonC