FrontEnd

메타태그 open graph (og)

Dean83 2024. 9. 27. 09:11

메타 태그는 웹사이트의 정보를 담는 태그로서, 보통 header 태그 아래에 존재한다. (꼭 그런것은 아니지만 주로 그렇다)

 

언어, title, 문자열 타입등을 설정 하기도 하고, 누군가에게 공유하기 위해 og를 필수로 설정을 해야 한다. 

 

(ex : 메신저에 사이트 주소 복붙하여 보낼때 보여주는 미리보기 항목들)

 

최소한 og:url, type, title, description, img 는 설정을 해 두어야 한다. 

 

<meta property="og:url"                content="웹사이트 주소" />
<meta property="og:type"               content="website" />
<meta property="og:title"              content="제목" />
<meta property="og:description"        content="설명부분" />
<meta property="og:image"              content="이미지 주소" />
<meta property="og:locale"			   content="ko_KR"/>

 

참고 : https://developers.facebook.com/docs/sharing/webmasters/