[help]内容集合的图片发布到线上无法展示的404 #7264
-
比如 MDX中写的是 cover: "/src/content/hotcard/_image/cangjun.jpg"最终发布到线上环境 访问的图片就是 www.domain.com/src/content/hotcard/_image/cangjun.jpg 结果就挂掉了 |
Beta Was this translation helpful? Give feedback.
Answered by
liruifengv
Mar 10, 2024
Replies: 1 comment 9 replies
-
你好。你应该用相对路径“./_image/canghun.jpg” 就会被自动处理了。 详情可以查看一下图片相关文档: |
Beta Was this translation helpful? Give feedback.
9 replies
Answer selected by
liruifengv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好。你应该用相对路径“./_image/canghun.jpg” 就会被自动处理了。
用/开头是网站根目录,只有存在public下的图片不会被转换,可以用/开头。
详情可以查看一下图片相关文档:
https://docs.astro.build/zh-cn/guides/images/#%E5%86%85%E5%AE%B9%E9%9B%86%E5%90%88%E4%B8%AD%E7%9A%84%E5%9B%BE%E5%83%8F