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

social cards plugin crashes when logo defined in theme config #4812

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

social cards plugin crashes when logo defined in theme config #4812

dgoosens opened this issue Jan 3, 2023 · 3 comments
Labels
needs reproduction Issue lacks a minimal reproduction .zip file

Comments

@dgoosens
Copy link

dgoosens commented Jan 3, 2023

Context

No response

Bug description

when a logo is defined in the theme config:

theme:
  logo: assets/images/logo.svg

and the social plugin is enabled, the logo can not be loaded and the system crashes (locally)

FileNotFoundError: [Errno 2] No such file or directory: '/docs/docs/assets/images/logo.svg'

if I change the path of the logo to:

theme:
  logo: ../overrides/assets/images/logo.svg

the system runs, the social cards are generated...
BUT the logo is not available on the rendered site

Also note that if custom fonts (non Google) are defined and are located in the overrides directory, one has to define a Google font for the social card plugin to work

Related links

Reproduction

simply define a logo, that is located in the overrides directory, in the theme section of mkdocs.yml
and enable the social plugin

#...
theme:
  custom_dir: overrides
  logo: assets/images/logo.svg
#...

plugins:
#...
  - social:
      cards: true
      cards_font: Roboto
#...

Steps to reproduce

  1. configure as indicated above
  2. make sure the dependencies are installed
  3. start local environment

Browser

No response

Before submitting

@dgoosens
Copy link
Author

dgoosens commented Jan 3, 2023

I temporary managed to hack this by setting the font as required by the social plugin

theme:
  logo: ../overrides/assets/images/logo.svg

and by defining a partial override of the logo.html partial

<!-- overrides/partials/logo.html -->

<img src="{{ 'assets/images/logo.svg' | url }}" alt="logo">

@squidfunk
Copy link
Owner

Thanks for reporting. However, this issue is incomplete.

Note that we have new bug reporting guidelines, which is also mentioned in the descriptions in the bug reporting template you filled out. You did not provide a reproduction, which is why we can't look into this issue. Please read our new bug reporting guidelines and how to create a reproduction.

@squidfunk
Copy link
Owner

squidfunk commented Jan 4, 2023

Closing as incomplete and not reproducible. If you can provide a reproduction, please reopen.

@squidfunk squidfunk added needs reproduction Issue lacks a minimal reproduction .zip file and removed incomplete labels Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Issue lacks a minimal reproduction .zip file
Projects
None yet
Development

No branches or pull requests

2 participants