Skip to content

Alternative Page Title Generator [v5-rc] #2610

Description

@BrysonC

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

Activity

  1. sy-records commented on Oct 17, 2025

    @sy-records
    Member

    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.

  2. BrysonC commented on Nov 3, 2025

    @BrysonC
    Author

    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).

  3. added a commit that references this issue on Mar 4, 2026
    4088a0c
  4. added a commit that references this issue on Mar 4, 2026
    0cfee34
  5. BrysonC commented on Mar 4, 2026

    @BrysonC
    Author

    @QingWei-Li : #2690 does a pretty good job of improving the situation but does not solve this problem completely.

    Using a name configuration like the one shown in the screenshot:
    <div style="text-align:center;"><img src="ExampleLogo.svg" style="display: block; margin: -30px auto; height:120px;"><br>example.wiki<br><small style="font-style: italic;">Woah! A subtitle.</small></div>

    Would result in a title of:
    Page - example.wikiWoah! A subtitle.

    Which is still a malformed result if the user would like it to be simply Page - example.wiki.

  6. BrysonC commented on Mar 16, 2026

    @BrysonC
    Author

    @sy-records / @Bowl42 Please reopen this issue as it is still not fully resolved in #2694 . Please see my note above.

  7. self-assigned this
    on Mar 16, 2026
  8. sy-records commented on Mar 16, 2026

    @sy-records
    Member

    Adding pages - example.wikiWoah! A subtitle.
    I think this is the right approach; we simply can't accommodate all user inputs.

    But I added a pageTitleFormatter config #2695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconfirmed as a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions