gencode
2126 0
오픈 그래프로 SNS에 공유하기
2018-01-11 16:10:09 - genonfire

트위터 오픈 그래프 미리보기 및 디버그

https://cards-dev.twitter.com/validator


페이스북 개체 디버거
https://developers.facebook.com/tools/debug/og/object/


메타 태그는 아래와 같이 넣음

{% block open_graph %}
    <meta property="twitter:card" content="summary">
    <meta name="twitter:title" content="{{ post.title }}">
    <meta property="og:site_name" content="{{ SITE_NAME }}">
    {% if post.tags %}
        <meta property="og:description" content="{{ post.tags }}">
        <meta name="twitter:description" content="{{ post.tags }}">
    {% else %}
        <meta property="og:description" content="{{ SITE_INFO }}">
        <meta name="twitter:description" content="{{ SITE_INFO }}">
    {% endif %}
    <meta property="og:url" content="{{ request.build_absolute_uri }}">
    <meta property="og:title" content="{{ post.title }}">
    {% if post.image %}
        <meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ post.image.url }}">
        <meta property="twitter:image" content="{{ request.scheme }}://{{ request.get_host }}{{ post.image.url }}">
    {% endif %}
    {% if FB_APP_ID %}
        <meta property="fb:app_id" content="{{ FB_APP_ID }}">
    {% endif %}
{% endblock %}

* 소스 출처: bbgo/blogs

이 글이 마음에 드셨다면.. 0
gencode 의 다른 포스트
Django Traffic Monitor + 트래픽 초과 알림
맥북 터미널을 우분투처럼..
무료 전자 결재 시스템 - bbgo
> 오픈 그래프로 SNS에 공유하기
favicon 만들기
네이버 영어사전에 네이버 번역 API 연동하기 (파파고)
PS4 프로 자동 구입 매크로 만들기 -5-
댓글 [ 0 ]