-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open
Description
Context
No response
Bug description
When mkdocs-material is configured with a custom icon set and the social plugin, the social plugin looks in the wrong place for the icon.
mkdocs.yml
site_name: My Docs
site_url: https://localhost:8000
theme:
name: material
custom_dir: overrides
icon:
logo: iconset1/myicon
plugins:
- search
- social
% mkdocs build
INFO - Cleaning site directory
INFO - Building documentation to directory: /Users/bz/dev/mkdocs-test/site
Traceback (most recent call last):
File "/Users/bz/dev/mkdocs-test/venv/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/mkdocs/__main__.py", line 250, in build_command
build.build(cfg, dirty=not clean)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/mkdocs/commands/build.py", line 332, in build
config.plugins.run_event('post_build', config=config)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/mkdocs/plugins.py", line 522, in run_event
result = method(**kwargs)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 173, in on_post_build
promise.result()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 180, in _cache_image
image = render_function()
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 160, in <lambda>
render_function = lambda: self._render_card(site_name, title, description)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 195, in _render_card
self._resized_logo_promise.result(),
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 334, in _load_resized_logo
logo = self._load_logo(config)
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 368, in _load_logo
return self._load_logo_svg(path, self.color["text"])
File "/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/plugins/social/plugin.py", line 373, in _load_logo_svg
data = open(path).read()
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/.icons/iconset1/myicon.svg'
Related links
Similar to Issue 4812, except in my case, a custom icon set is being used instead of a custom image.
Reproduction
Note: I have commented out the custom_dir in the reproduction so that the info plugin would run. This customization is mentioned in the logo and icons documentation that I referenced.
example.zip
Steps to reproduce
- Uncomment
theme.custom_dirin mkdocs.yml mkdocs buildormkdocs serve- Error from the social plugin looking in the material theme folder instead of the override folder
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bz/dev/mkdocs-test/venv/lib/python3.10/site-packages/material/.icons/iconset1/myicon.svg'
Browser
Chrome
Before submitting
- I have read and followed the bug reporting guidelines.
- I have attached links to the documentation, and possibly related issues or discussions.
- I assure that I have removed all customizations before submitting this bug report.
- I have attached a .zip file with a minimal reproduction.
fredrikaverpil
Metadata
Metadata
Assignees
Labels
bugIssue reports a bugIssue reports a bugresolvedIssue is resolved, yet unreleased if openIssue is resolved, yet unreleased if open