trophy-jekyll icon indicating copy to clipboard operation
trophy-jekyll copied to clipboard

Image Linking

Open jaythanelam opened this issue 9 years ago • 10 comments

screenshot 2016-12-24 09 19 23 Hello_ I'm having difficulty linking to an image in the Assets folder, and I've noticed you link to images using an outside url. Does the theme accept internal paths to images, and if so how does it do so? Not, i'm not the best developer, so this could be a problem with me. However, I am able to get this to work locally.

jaythanelam avatar Dec 24 '16 14:12 jaythanelam

Could you please elaborate on the issue? This theme works well with linking to images using each of the ways Jekyll documentation advises. An example of using both of the ways

adaRn avatar Dec 24 '16 15:12 adaRn

perhaps its a Github setting, as I'm using the method correctly. all I know is that when I push my files to Github the images no longer work. the files are in github, but they don't render.

jaythanelam avatar Dec 24 '16 17:12 jaythanelam

Could this possibly be related to #12 ?

adaRn avatar Dec 24 '16 22:12 adaRn

I'm guessing @adaRn is correct and it is related to #12. You also don't need image-sm if it is the same as image. It is just an option to optimize the page speed on card views.

thomasvaeth avatar Dec 25 '16 02:12 thomasvaeth

Thanks @thomasvaeth, I updated the image in the comment so it's no longer misleading.

adaRn avatar Dec 25 '16 17:12 adaRn

Yes @thomasvaeth and @adaRn, it does appear that I am having a similar issue. However, I've just gone through all of the scenarios you both mentioned in issue #12 and I still can't get the images to work properly. I can get all images to work locally using /assets/tn-titans.jpg for both post and profile pic, but I'm unable to achieve that success once I've pushed everything to Github. I even adjusted the base url several times to try and see it was a combination there that might change things. I also tried using absolute urls to the images and that didn't work either. What am I doing wrong?

jaythanelam avatar Dec 25 '16 20:12 jaythanelam

Did you look at the the _site folder? How are the images being outputted?

thomasvaeth avatar Dec 26 '16 03:12 thomasvaeth

Hi @jaythanelam , try this image: /../assets/tn-titans.jpg Keep in mind that you are trying to access assets folder from posts folder.

Also, @thomasvaeth , image and image-sm are two different things

  • image is for preview image of latest post at home page
  • image-sm is for header image for the particular post

prakhar2b avatar Jan 02 '17 07:01 prakhar2b

@prakhar2b I know image and image-sm are two different things, but you have them backwards. image-sm is for the cards since you don't need a huge image for those.

thomasvaeth avatar Jan 04 '17 05:01 thomasvaeth

Closing because original poster hasn't answered in 10 days. Images work for everyone else.

thomasvaeth avatar Jan 04 '17 05:01 thomasvaeth