head: # URL or path to the website's icon favicon: /img/star.svg # Open Graph metadata # https://hexo.io/docs/helpers.html#open-graph open_graph: # Page title (og:title) (optional) # You should leave this blank for most of the time title: # Page type (og:type) (optional) # You should leave this blank for most of the time type: article # Page URL (og:url) (optional) # You should leave this blank for most of the time url: # Page cover (og:image) (optional) # You should leave this blank for most of the time image: /img/고정이미지이름.png # Site name (og:site_name) (optional) # You should leave this blank for most of the time site_name: # Page author (article:author) (optional) # You should leave this blank for most of the time author: sowon-dev
해결
하지만 나는 썸네일이 있는 게시글은 썸네일이 미리보기 이미지로 보이고 썸네일이 없다면 내가 지정한 기본 이미지로 보이고 싶었다. 따라서 config.yml 파일의 open_graph: 하위 image: 를 다시 공백으로 한 뒤
head: # URL or path to the website's icon favicon: /img/star.svg # Open Graph metadata # https://hexo.io/docs/helpers.html#open-graph open_graph: # Page title (og:title) (optional) # You should leave this blank for most of the time title: # Page type (og:type) (optional) # You should leave this blank for most of the time type: article # Page URL (og:url) (optional) # You should leave this blank for most of the time url: # Page cover (og:image) (optional) # You should leave this blank for most of the time image: # Site name (og:site_name) (optional) # You should leave this blank for most of the time site_name: # Page author (article:author) (optional) # You should leave this blank for most of the time author: sowon-dev
아래 경로의 og_image.png 찾은 뒤 내가 원하는 이미지로 바꿔치기 해주면 해결!
경로: public/img/og_image.png
카카오톡 미리보기에는 여전히 반영이 안된다면?
카카오톡에서 만든 공유 디버거에 해당 글 주소를 입력하면 OG(Open Graph) 프로토콜을 통해 파싱하고 스크랩 결과도 친절하게 알려준다. 여기서 캐시 초기화를 누르면 카카오톡 미리보기가 반영된다!