Skip to content

본문 이미지 sizes가 100vw라 1x 데스크톱이 큰 파일을 받음 #9

Open

Description

@seungwonme

image.layout: "constrained"가 만드는 sizes가 (min-width: 2000px) 2000px, 100vw입니다. 본문 폭은 max-w-3xl(768px, 좌우 여백 빼면 736px)인데 브라우저는 이미지가 화면 전체 폭이라고 보고 파일을 고릅니다.

실측(2026-09-23, 2,000px PNG): 640w 15.6KB, 960w 30.5KB, 1280w 46.1KB, 1920w 86.7KB, 2000w 95.1KB.

  • 1x 데스크톱(1920px 화면): 지금 1920w(86.7KB)를 받음. 본문 폭 기준이면 960w(30.5KB)로 충분
  • 레티나 노트북: 지금 2000w(95.1KB), 본문 폭 기준이면 1920w(86.7KB)라 차이 작음
  • 모바일: 화면 폭이 곧 본문 폭이라 차이 없음

Markdown 이미지에는 sizes를 개별로 줄 수 없어서, 고치려면 rehype 플러그인으로 본문 <img>의 sizes를 (min-width: 768px) 736px, 100vw로 바꾸는 방법 등을 검토해야 합니다. 급하지 않아 이슈로 남깁니다.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions