Hi all I am having issue with one of my repositories https://github.inkcoo.com/Mitch3012/johnmitchelldev.dev #195012
Replies: 4 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Mitch3012, this is a common hurdle when moving from a local environment to GitHub Pages. Since it works locally but not online, the issue is likely related to how the server handles file paths. Here are the most likely causes and how to fix them:
I hope this helps you get your site up and running! |
Beta Was this translation helpful? Give feedback.
-
|
This is a very common issue when moving a project from a local environment to GitHub Pages. Based on your repository structure, the problem is almost certainly due to file paths or case sensitivity. Here are the two most likely causes and how to fix them: Cause 1: Incorrect File Paths (The "Leading Slash" Issue)This is the most common reason. If you are using absolute paths that start with a forward slash / in your img tags, they will fail on GitHub Pages if your repository is a "Project Page" (which yours is, since it's not named username.github.io). The Problem: On your local computer, a path like /emailicon.jpg might look in your project's root folder. On GitHub Pages, the URL of your site is https://mitch3012.github.io/johnmitchelldev.dev/. A path starting with / tells the browser to look at the very top level (https://mitch3012.github.io/emailicon.jpg), which does not exist. The Fix: Change your img tags in index.html to use relative paths. <!-- Bad (Absolute Path) -->
<img src="/emailicon.jpg" alt="Email">
<img src="/GitHubicon.jpg" alt="GitHub">To this: <!-- Good (Relative Path - looks in the same folder) -->
<img src="emailicon.jpg" alt="Email">
<img src="./GitHubicon.jpg" alt="GitHub">Cause 2: Case SensitivityGitHub Pages runs on a Linux server, which is case-sensitive. If you are developing on Windows, your file system is likely case-insensitive, meaning EmailIcon.jpg and emailicon.jpg are treated as the same file. On GitHub, they are completely different files. The Problem: I can see your files in the repository are named GitHubicon.jpg (Capital G, i) and emailicon.jpg (lowercase). If your HTML code references them differently (e.g., src="githubicon.jpg"), it will work on Windows but break on GitHub. The Fix: Ensure the capitalization in your HTML src attribute exactly matches the filename in your repository. Repo file: GitHubicon.jpg ➡️ HTML should be: src="GitHubicon.jpg" How to verify the exact errorTo confirm which of these is the problem: 1.Open your website on GitHub Pages.Right-click the broken image and select Inspect (or press F12 to open Developer Tools). Summary of what to do:Open your index.html and ensure your image tags look like this (assuming the images are in the same folder as index.html): <!-- Make sure the name matches the file exactly -->
<a href="mailto:your@email.com">
<img src="emailicon.jpg" alt="Email Icon">
</a>
<a href="https://github.inkcoo.com/Mitch3012">
<img src="GitHubicon.jpg" alt="GitHub Icon">
</a>If You Find this helpful, do mark this as the answer , hope your issue gets solved soon. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Mitch3012 You will check the few things to solve this issue:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Bug
Body
When I load it locally on my system it works but on git hub pages it does not display the email and git hub images any ideas why that is?
Beta Was this translation helpful? Give feedback.
All reactions