Skip to content

Logo not picked up if not in public folder #3246

@koebi

Description

@koebi

Describe the bug

The documentation for the logo states

Logo file to display in nav bar, right before the site title. Accepts a path string, or an object to set a different logo for light/dark mode.
and the following suggests that putting a logo in the root folder works:

 export default {
  themeConfig: {
    logo: '/logo.svg'
  }
}

Documentation about static assets suggests that

Common image, media, and font filetypes are detected and included as assets automatically.

However, it seems that the logo has to be put in the public folder to be picked up.

Reproduction

  • Set up default site with npx vitepress init
    *include a logo as given above
  • put it in root
  • see it not being picked up

Expected behavior

Either documentation should mention including the logo in public or it should get picked up from root.

System Info

System:
    OS: Linux 6.5 Debian GNU/Linux trixie/sid
    CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
    Memory: 17.38 GB / 30.58 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm


### Additional context

_No response_

### Validations

- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions