본문 바로가기

TIL

TIL 062223

https://stackoverflow.com/questions/23463679/s3-static-pages-without-html-extension

 

S3 static pages without .html extension

In serving a static site off of Amazon S3, I'm wondering how to get rid of the .html file extensions for each page. Right now I have: mysite.com/ # works fine, serves index.html mysit...

stackoverflow.com

https://anands.github.io/blog/2018/11/18/serve-static-pages-on-s3-without-html-extension/

 

Serve Static Pages on S3 Without .html Extension - Anand Sudhanaboina

Hosting static HTML pages generated by Jekyll or any other static site generator with pretty permalinks (the one’s without .html) on to S3 would yield into a 404. The reason is that S3 is an object store hence it doesn’t really look up for a .html vers

anands.github.io

.html 파일 확장자 없애기

원래 react 뭐 이런걸로 하면 쉬운가보다.


https://velog.io/@miracle-21/DRFPagination

 

[DRF]Pagination 구현

"이전/다음" 링크를 사용하여 여러 페이지로 분할된 데이터를 관리

velog.io

이미지 파일 경로에 backend:8000이런게 붙어서 화면에 안 불러와지는 현상 발생.

상세보기 페이지에선 잘 나오는데 목록 페이지에서 이미지가 안 나왔다.

pagination 때문에 그런거였다.

예전에 next에 있던 경로도 마찬가지.

내가 했던 next처럼 프론트에서 .split("/")으로 쪼갠 후 proxy를 붙여서 경로를 재조립할 수 있겠지만 팀장님이 한번에 backend에서  get_next_link() 함수 오버라이딩으로 next link 수정.

그리고 이미지 경로는 위의 포스팅에 나온대로 

def get_serializer_context(self):
        return {
            'request': None, # None이 아닌 경우에 full url 표시
            'format': self.format_kwarg,
            'view': self
        }

추가.

.split("/")로 쪼개서 다시 조립하기 말고 replace(<이상한부분>,proxy)해줄수도 있다.


https://redcow77.tistory.com/561

 

[Javascript] 자바스크립트(JS) Image 파일 용량 체크

자바스크립트(Javascript)의 Image 파일 용량 체크하기 자바스크립트(Javascript)로 Image 파일의 용량을 체크하는 방법입니다. 제일 먼저 input 태그로 Image 파일을 첨부하고 Image 파일의 용량을 확인해보

redcow77.tistory.com

업로드 파일 용량 제한

나는 업로드 시 alert가 뜨게 했는데

업로드 전 파일첨부 시에도 할 수 있다.

files[0].size가 용량


https://debuck.tistory.com/4

 

[Javascript] select option control (value값으로 selected 하기)

select 박스에 있는 option값을 선택해줘야 할 때가 있다. 예를 들어, 작성 된 내용을 바탕으로 수정 시라던가, 버튼을 누르면 자동으로 선택해줘야한다던가. value값을 알면 selected 가능한 간단한 예

debuck.tistory.com

el.options[i].selected = true; 이렇게 옵션을 선택해줄 수 있다.

el.options[i].setAttribute("selected", "selected")보다 간단하다.


https://nykim.work/86

 

[CSS] 이미지 사이즈 맞추기 (object-fit, absolute, background)

프롤로그 컨테이너의 크기는 고정되어 있는데, 해당 컨테이너 안에 들어갈 이미지의 크기는 다양한 경우가 있습니다. 사용자가 이미지를 등록하는 경우 또는 마케팅 팀이 아무 이미지나 넣는

nykim.work

프로필 이미지에서 납작한 사진이 붕 뜨게 나왔다.

이거는 왜 맨날 검색 ㅜㅠ

object-fit:cover와 width:100%로 해결했는데 길쭉한 사진은 어떻게 나오려는지 모르겠다.

heigth:100%도 추가하면 되려나...


프로필 정보 수정 시 비밀번호를 아예 입력 안하면 괜찮은데 비밀번호1만 입력하거나 또는 비밀번호2만 입력하면 alert를 띄우도록 만들기!

and 연산자는 앰퍼샌드 2개 && 이거다.

'TIL' 카테고리의 다른 글

TIL 062623  (0) 2023.06.26
TIL 062323  (0) 2023.06.23
TIL 062123  (0) 2023.06.21
TIL 062023  (0) 2023.06.20
TIL 061923  (0) 2023.06.19