Permalink
Browse files

Add some open graph improvements

  • Loading branch information...
paltman committed May 23, 2015
1 parent f7b9e77 commit 1094bf0e4a2068c628dd9871f36ba70428bf14b7
Showing with 23 additions and 3 deletions.
  1. +18 −3 ppb/templates/pinax/blog/blog_post.html
  2. +5 −0 ppb/templates/site_base.html
@@ -5,9 +5,24 @@
{% block head_title %}{{ post.title }} — {{ SITE_NAME }}{% endblock %}
{% block extra_head %}
<meta name="description" content="{{ post.teaser_html|striptags }}">
<meta name="og:title" content="{{ post.title }}">
<meta name="og:description" content="{{ post.teaser_html|striptags }}">
{{ block.super }}
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://pbs.twimg.com/profile_images/62846141/pinaxproject_avatar.png">
<meta property="og:title" content="{{ post.title }}">
{% if post.description %}
<meta name="description" content="{{ post.description }}">
<meta property="og:description" content="{{ post.description }}">
{% else %}
<meta name="description" content="{{ post.teaser_html|striptags }}">
<meta property="og:description" content="{{ post.teaser_html|striptags }}">
{% endif %}
{% if post.primary_image %}
<meta property="og:image" content="http://{{ SITE_DOMAIN }}{{ post.primary_image.image_path.url }}">
{% else %}
<meta property="og:image" content="https://pbs.twimg.com/profile_images/62846141/pinaxproject_avatar.png">
{% endif %}
<meta property="og:url" content="http://{{ SITE_DOMAIN }}{{ post.get_absolute_url }}">
<meta property="og:type" content="article">
{% endblock %}
{% block content %}
@@ -3,6 +3,11 @@
{% load staticfiles %}
{% load i18n %}
{% block extra_head %}
{{ block.super }}
<meta name="twitter:site" content="@pinaxproject">
<meta property="og:site_name" content="The Pinax Blog">
{% endblock %}
{# remove to bring back topbar #}
{% block topbar_base %}{% endblock %}

0 comments on commit 1094bf0

Please sign in to comment.