Repository: squidfunk/mkdocs-material

Issue #7076: Support `mkdocs 1.6.0`
Created: 2024-04-22T09:36:02Z
NoteEdit by @squidfunk: fix available, please check if your documentation builds successfully, see #7076 (comment)


Context
When I try to install mkdocs 1.6.0 I get a warning from pip that mkdocs-material only supports a 1.5.x version of mkdocs.
Copy/pasting a relevant comment from @squidfunk:

Happy to collaborate on the 1.6 transition! Former minor version MkDocs releases sometimes broke parts of Material for MkDocs, which is why we decided to be a little more selective about what version we support. I currently have other things on my plate, but if you'd like to collaborate on a PR to bring Material for MkDocs and Insiders to 1.6, I'm happy to help wherever I can. Reading the release notes of 1.6, I think it should be pretty straight forward to support.

Source for comment: renovatebot/renovatebot.github.io#439 (comment)
I don't feel confident to work on the code on mkdocs-material. I can at least make an issue for this work, so you can track it. Maybe someone from the community can help you work on this feature.
Description
Update Material for MkDocs so it works with 1.6.0. of mkdocs.
Related links
Read the mkdocs 1.6.0 changelog to check for important changes.
mkdocs 1.6.0 also has a new enabled setting for all plugins. I don't know if/how this affects Material for MkDocs. Maybe you should default to enabled: false on some parts, or explictly enabled: true on others...
Use Cases
MkDocs 1.6.0 has new validation options:

opt-in to validate absolute links
opt-in to validate absolute links within nav
recommended to validate anchors in links

It's a good idea to validate the links before publishing the docs, that way readers don't suddenly end up with a broken link.
Visuals
No response
Before submitting

 I have read and followed the change request guidelines.
 I have verified that my idea is a change request and not a bug report.
 I have ensured that, to the best of my knowledge, my idea will benefit the entire community.
 I have included relevant links to the documentation, related issues, and discussions to underline the need for my idea.

Duplicate issue #6983: ⚠️ Social cards broken – update to 9.5.17
Created: 2024-03-28T14:43:48Z
NoteEdit by @squidfunk: Please update to the latest version before raising another issue or opening a discussion. The problem has been fixed and released as part of 9.5.17, and is reported to fix the BadZipFile error.


Context
The social plugin tries to fetch fonts from Google and to unzip them:
https://github.com/squidfunk/mkdocs-material-insiders/blob/4ff6a572151f684fe2e21527582e1096a88805d0/src/plugins/social/plugin.py#L857
Bug description
Google no longer provides direct access to the zip file, so building sites fails.
  File "/usr/local/lib/python3.12/site-packages/material/plugins/social/plugin.py", line 522, in _render_typography
    path = self._resolve_font(family, style, variant)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/material/plugins/social/plugin.py", line 809, in _resolve_font
    self._fetch_font_from_google_fonts(family)
  File "/usr/local/lib/python3.12/site-packages/material/plugins/social/plugin.py", line 876, in _fetch_font_from_google_fonts
    archive = ZipFile(f)
              ^^^^^^^^^^
  File "/usr/local/lib/python3.12/zipfile/__init__.py", line 1341, in __init__
    self._RealGetContents()
  File "/usr/local/lib/python3.12/zipfile/__init__.py", line 1408, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Workaround was disabling the social plugin.
Related links

Reporting a bug

Reproduction
Using the code referenced above shows that the link provides HTML data.
Steps to reproduce
import requests
family= "Noto Sans"
url = f"https://fonts.google.com/download?family={family}"
res = requests.get(url, stream = True)
for chunk in res.iter_content(chunk_size = 8192):
    print(chunk)

<script data-id="_gd" nonce="lai0FBQz_50-Cv_k8L_woA">window.WIZ_global_data
...snip...

Browser
No response
Before submitting

 I have read and followed the bug reporting guidelines.
 I have attached links to the documentation, and possibly related issues and discussions.
 I assure that I have removed all customizations before submitting this bug report.
 I have attached a .zip file with a minimal reproduction using the built-in info plugin.

Closing comment (2024-04-22T08:24:50Z): We don't yet support MkDocs 1.6, because MkDocs has had a history of breaking changes in minor releases, which is why we've limited to <1.6 for now. We'll try to upgrade to 1.6 quickly, but I currently need to finish other things for Material for MkDocs, so I'm happy to collaborate if somebody wants to go ahead and do the legwork ☺️
Edit: This is now tracked in #7076.