-
[Github 배포 에러] Github 배포시 이미지 안뜸개발 일지 2024. 5. 3. 00:45
<div class="img"> <img src="https://tenotion.site/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F83c75a39-3aba-4ba4-a792-7aefe4b07895%2F787d9587-e4e6-409c-866e-39a706799316%2FKakaoTalk_20240415_125230230.jpg?table=block&id=5a708879-c1df-4e3b-9a9e-888e2ee84e4b&spaceId=83c75a39-3aba-4ba4-a792-7aefe4b07895&width=2000&userId=&cache=v2" class="img-thumbnail" alt=""> </div>
위 코드처럼 웹페이지에서 가져온 사진 링크를 넣었다.
분명 처음에는 로컬과 Github로 배포한 페이지에서 정상적으로 뜨는 것을 봤는데,,,,,
오늘 들어가보니 갑자기 사진만 안뜨는 오류가 발생했다....띠로리.......
찾아보니 나와 같은 사례는 없어서 그냥 이미지 폴더 만들어서 넣어줬다
다음에 찾아서 원인 밝혀내는걸로....
원인
github pages에서 폴더를 인식하는 방법이 다르다.
폴더 구조는 아래처럼 나타낼 수 있다.
./ -> 현재 폴더 ../ -> 상위 폴더 ../../ ->상위 폴더의 상위 폴더
해결
폴더의 위치를 맞춰주면 이미지가 잘 나오는 것을 확인할 수 있다.
(./경로 or 폴더 이름(images/) or 절대경로"를 사용하면 된다.)
<div class="img"> <img src="./얼굴사진.jpg" class="img-thumbnail" alt=""> </div>
참고
'개발 일지' 카테고리의 다른 글
IntelliJ로 Git clone 하기 (0) 2024.05.04 Github로 배포하기 (0) 2024.04.30 [2team_introduce] HTML file들 합쳐서 페이지 이동 구현 (0) 2024.04.28 [오류 해결] Github commit 반영되지 않는 이유(잔디가 심어지지 않는 경우) (0) 2024.04.27 [2team_introduce] 비밀번호 정규식, 수정/삭제 Modal 창 만들기 (0) 2024.04.17