Skip to content

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

@dgoosens

Description

@dgoosens

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reproductionIssue lacks a minimal reproduction .zip file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions