카카오톡에 링크를 공유했을 때 나오는 미리보기를 Meta Tag 의 og 를 이용하여 설정할 수 있다.
<meta property="og:type" content="website" />
<meta
property="og:url"
content="https://parispoly137.github.io/react-crypto_tracker/"
/>
<meta property="og:title" content="Crypto Tracker" />
<meta
property="og:image"
content="https://img.sbs.co.kr/newimg/news/20220720/201683995_1280.jpg"
/>
<meta
property="og:description"
content="A site that shows a list of coins and shows charts and prices by calling the real-time market price of each coin."
/>
<meta property="og:site_name" content="Crypto Tracker" />
<meta property="og:locale" content="en_US" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
# 양식
<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com/page.html">
<meta property="og:title" content="Content Title">
<meta property="og:image" content="https://example.com/image.jpg">
<meta property="og:description" content="Description Here">
<meta property="og:site_name" content="Site Name">
<meta property="og:locale" content="en_US">
<!-- 다음의 태그는 필수는 아니지만, 포함하는 것을 추천함 -->
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
* index.html 의 head 태그 안에 정의한다.
만약 설정했는데 카카오톡에서 미리보기가 제대로 나오지 않는 경우,
https://developers.kakao.com/tool/debugger/sharing
위의 kakao developers의 공유 디버거에서 캐시 초기화를 하면 된다.
참고)
- https://imweb.me/faq?mode=view&category=29&category2=47&idx=70639
'Front-end > HTML' 카테고리의 다른 글
HTML) Semantic Tags - 이름 자체에 의미가 있는 태그들 (0) | 2022.10.03 |
---|---|
HTML) 주요 사용 Tag 정리 + 찾아보는 방법 (1) | 2022.10.03 |