You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitHub Pages Jekyll模板生成页面中README.md预览图不显示求助

Fixing Preview Images Not Showing in Your GitHub Pages Jekyll Site

Hey there, let's get those preview images working! The main issue here is how you're linking to your images—here's what's going wrong and how to fix it:

The Root Problem

You're using a GitHub repository browser page link (the one with blob in the URL) for your image, not a direct image file link. Jekyll can't render that web page as an image, so it shows up broken.

Quick Fixes to Try

You don't even need to navigate to the image to fix this—just edit your URL:

  • Original link: https://github.com/0x1C1B/JContacts/blob/master/doc/img/[your-image]
  • Change blob to raw: https://github.com/0x1C1B/JContacts/raw/master/doc/img/[your-image]

That's the direct link to the image file itself, which Jekyll can load properly.

2. Use Relative Paths (Even Better!)

Since your site is hosted on GitHub Pages tied directly to your repository, relative paths are more reliable and avoid URL issues entirely. If your README is in the repo root and your images live in doc/img/, just write:

![Preview Image](doc/img/[your-image])

Jekyll will automatically resolve this path relative to your site's root, no matter what your repo's base URL is.

3. Double-Check Case Sensitivity

GitHub Pages runs on a case-sensitive server, so make sure your path matches exactly what's in your repo. For example, if your folder is named doc/img (all lowercase), don't write Doc/Img in your markdown—this will break the link.

Once you make one of these changes, commit and push your README, and your GitHub Pages site should load the images correctly in no time!

内容的提问来源于stack exchange,提问作者Constantin Müller

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:22:46