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

Search plugin crashes on numeric page titles in nav #4817

Closed
4 tasks done
planetf1 opened this issue Jan 3, 2023 · 6 comments
Closed
4 tasks done

Search plugin crashes on numeric page titles in nav #4817

planetf1 opened this issue Jan 3, 2023 · 6 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@planetf1
Copy link

planetf1 commented Jan 3, 2023

Context

We noticed our github actions which use mkdocs-material failing yesterday, co-inciding with the update of mkdocs-material to 9.0.0 (we do a pip install within our workflow)

Bug description

mkdocs build is failing with errors such as

ERROR    -  Error building page 'release-notes/1-0.md': can only join an iterable
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.1/x64/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^

Link above has the full error

Related links

Reproduction

example.zip

Steps to reproduce

mkdocs serve

Browser

No response

Before submitting

@planetf1
Copy link
Author

planetf1 commented Jan 3, 2023

The specific cause here seems to be our use of filenames like '1-0.md' where this is also referenced in mkdocs.yml
In 8.5.3 this worked, in 9.0.1 this fails

@planetf1
Copy link
Author

planetf1 commented Jan 3, 2023

Ref: original discussion: #4816

@squidfunk
Copy link
Owner

Thanks for reporting! I'll look into it.

@squidfunk squidfunk added the bug Issue reports a bug label Jan 3, 2023
@squidfunk
Copy link
Owner

squidfunk commented Jan 3, 2023

Fixed in 4548afb. Thanks for the excellent reproduction which made fixing this error a breeze. The error was caused because of the use of a float in mkdocs.yml as a title for a page:

nav:
  ...
  - 1.0: release-notes/1-0.md

This was not handled by the search plugin before. To mitigate the issue before the next release (we just pushed out 9.0.1 and want to collect some more bug fixes before 9.0.2), put 1.0 in quotes: "1.0" or install from git.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Jan 3, 2023
@squidfunk squidfunk changed the title mkdocs-material 9.0.0 - fails to build (search) with numeric filenames in page index Search plugin crashes on numeric page titles in nav Jan 3, 2023
@planetf1
Copy link
Author

planetf1 commented Jan 3, 2023

Brilliant. Thanks for super quick fix and glad we could help improve! Mkdocs material is great!

@squidfunk
Copy link
Owner

Released as part of 9.0.2.

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