vitepress
vitepress copied to clipboard
PDF not included in assets directory
Describe the bug
If I reference a PDF from a Markdown file like so:
Please see this [document](./doc.pdf)
And the doc.pdf lives in the same directory as the Markdown file, Vitepress does not process the PDF & add it to the assetsDir during build, resulting in 404 when the site is deployed.
The documentation on Referencing Static Assets seems to suggest it should. Am I missing something or is this not supported?
(Right now I'm working round this by placing the file in the /public directory)
Reproduction
Explained above.
Expected behavior
I would expect the PDF to be available as an asset.
System Info
System:
OS: Linux 6.5 Ubuntu 23.10 23.10 (Mantic Minotaur)
CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
Memory: 47.97 GB / 62.54 GB
Container: Yes
Shell: 5.2.15 - /bin/bash
Binaries:
Node: 20.11.0 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 10.2.4 - /usr/bin/npm
pnpm: 8.6.12 - ~/.local/share/pnpm/pnpm
Browsers:
Chrome: 121.0.6167.139
Chromium: 121.0.6167.85
npmPackages:
vitepress: 1.0.0-rc.40 => 1.0.0-rc.40
Additional context
No response
Validations
- [X] Check if you're on the latest VitePress version.
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Things referenced by links are not treated like assets. Only these are:
{
video: ['src', 'poster'],
source: ['src'],
img: ['src'],
image: ['xlink:href', 'href'],
use: ['xlink:href', 'href']
}
You'll need to keep other things in public directory.
First, thanks for the super quick response on this.
Second, might it worth updating the documentation to make this a little more explicit? As currently written the example seems to imply that as long as the asset is referenced from Markdown, then Vitepress will handle it.
Thanks again for Vitepress :+1: