简体   繁体   English

github页/github.io上不显示图片

[英]Images are not displayed on github pages/github.io

My images in the.markdown files are not displayed on site, but they are displayed well locally and in the repository.我在.markdown文件中的图片在现场显示不出来,但是在本地和仓库中都显示的很好。

Please see my github.io repository: https://github.com/TravisBAO/travisbao.github.io/blob/main/docs/_posts/2023-01-18-SSHKey.markdown请查看我的 github.io 存储库: https://github.com/TravisBAO/travisbao.github.io/blob/main/docs/_posts/2023-01-18-SSHKey.markdown

And if open the github page, they are not there: https://travisbao.github.io/2023/01/19/SSHKey.html如果打开 github 页面,它们不在那里: https://travisbao.github.io/2023/01/19/SSHKey.html

I try all the potential solutions:我尝试了所有可能的解决方案:

  1. use the html format使用 html 格式
  2. change the location of the file更改文件的位置
  3. change the.PNG to.JPG把.PNG改成.JPG

You're pretty much there, all you need to do is to use the correct uri for the source.您几乎就在那里,您需要做的就是为源使用正确的 uri。 Your images are located at "/assets/images/{filename}" .您的图片位于"/assets/images/{filename}"

In the screenshot below, I edited the path that the image tags pointed to and was able to get the images to load correctly.在下面的屏幕截图中,我编辑了图像标签指向的路径并能够正确加载图像。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM