How to fix the responsive design from github page and broken images?

狂风中的少年 提交于 2019-12-13 03:37:50

问题


I have a portfolio site deployed at github pages and I used jekyll to create it. The issues that I have : 1)The responsive design at mobile it's not right and I also can't see footer, 2) I have broken images that doesn't load i have changed the path several times but still doesn't work i guess I'm out of options?Any suggestions to fix these issues? My site : https://lazospap.github.io/LazPap/ and my repo : https://github.com/LazosPap/LazPap .


回答1:


To make sure that the image urls are found, you can tell Jekyll where the image is before processing using the link tag. Jekyll will track the link of the image before and after processing, so you can rely on your repo's current structure instead of the structure after processing.

<img src="{% link images/CSS_3.png %}" class="background-image-right"/>

Docs on link tag

Another tip is to create a .gitignore, add the following files to the .gitignore and then delete them from being tracked by git. You don't need them in your source control.

// .gitignore

.jekyll-cache
_site/

When I run your repo locally and make the browser mobile responsive, the images are not shrinking down. But, I can see your footer. I'm not familiar with the framekworks you're using, though.




回答2:


Instead of using link, you can also do this:

<img src="{{ '/images/CSS_3.png' | prepend: site.baseurl }}" class="background-image-right"/>


来源:https://stackoverflow.com/questions/58600579/how-to-fix-the-responsive-design-from-github-page-and-broken-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!