Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When title in metadata, can not search and show title in search list. #3980

Closed
5 tasks done
gledos opened this issue Jun 3, 2022 · 5 comments
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@gledos
Copy link

gledos commented Jun 3, 2022

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

When title in metadata, can not search and show title in search list.

Expected behaviour

Title in search list.

Actual behaviour

Can not search and show title in search list.

Discussions: #3978

Steps to reproduce

Markdown file like:

---
title: test
---

## H2

Package versions

  • Python: 3.9.7
  • MkDocs: 1.3.0
  • Material: 8.2.7

Configuration

site_name: metadata title test

theme:
  name: material

plugins:
  - search

System information

  • Operating system: Windows 10
  • Browser: Firefox 100
@squidfunk squidfunk added the needs investigation Issue must be investigated by the maintainers label Jun 3, 2022
@squidfunk
Copy link
Owner

Confirmed. MkDocs will not respect the title via front matter when building the search index. Also, in your example, you did not explicitly set the h1, which will result in the first h2 being the page title, which is already fixed in the new built-in search plugin, a complete rewrite of MkDocs own search plugin.

@squidfunk squidfunk added bug Issue reports a bug and removed needs investigation Issue must be investigated by the maintainers labels Jun 4, 2022
@squidfunk
Copy link
Owner

squidfunk commented Jun 4, 2022

Fixed in 0f19611. The new built-in search will now use the title set via front-matter over the h1 or the page name in mkdocs.yml. Note that we can only ship this fix as part of Insiders, as the new built-in search was not released into the community edition yet. In case you don't want to use Insiders, please upstream this issue to MkDocs.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jun 4, 2022
@gledos
Copy link
Author

gledos commented Jun 4, 2022

thanks for your help, I have submitted this issue to MkDocs.

mkdocs/mkdocs#2859

So this issue should be closed now, right?

@squidfunk
Copy link
Owner

I'll close it when I released the changes in Insiders 😊

@squidfunk
Copy link
Owner

Released as part of 8.3.1+insiders-4.17.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants