GitHub Pages Jekyll模板生成页面中README.md预览图不显示求助
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
1. Swap to a Raw Image Link
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
blobtoraw: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:

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

