简体   繁体   English

无法在Github页面上加载图像博客文章

[英]Not able to load images on Github pages Blog post

I wanted to publish a blog post, which contains a plot. 我想发布一个博客文章,其中包含一个情节。 I am perfectly able to view and load the image in markdown, but when I try to publish to on my github pages, I can see everything perfectly except for the plot. 我完全能够查看并加载markdown中的图像,但是当我尝试发布到我的github页面上时,除了情节之外,我都能看到所有其他内容。 Here is my Github repo for my blog and here is the markdown file I wish to post online. 这是我的博客的Github存储库 ,这是我希望在线发布的markdown文件

In the above post I am trying to display the image with: ![](DV_files/figure-html/unnamed-chunk-2-1.png) having the image located at _posts/DV_files/figure-html/unnamed-chunk-2-1.png . 在以上文章中,我尝试使用以下图片显示图片: ![](DV_files/figure-html/unnamed-chunk-2-1.png) ,图片位于_posts/DV_files/figure-html/unnamed-chunk-2-1.png

  1. Create a folder to hold your posts images at root level 创建一个文件夹以将您的帖子图像保留在根级别

     mkdir images 
  2. Move the directory structure containing the images to the above folder 将包含图像的目录结构移动到上述文件夹中

     mv _posts/DV_files/ images/ 
  3. Use the new path and use absolute_url to generate the full url 使用新路径并使用absolute_url生成完整的URL

     ![]({{"/images/DV_files/figure-html/unnamed-chunk-2-1.png"|absolute_url}}) 

Now your images will appear in the post. 现在,您的图像将出现在帖子中。

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

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