Skip to content

Commit

Permalink
FB open graph does not support SVG images only use png/jpg/jpeg on gu…
Browse files Browse the repository at this point in the history
…ide pages

- Add explicit width/height and description to satisfy open graph debugger warnings
- This will fallback to the user's avatar image if the stack image isn't the
  right format.
- We're planning on transitioning to png for stack images so this should
  automatically work once that change happens.
    - Follow #89 for more discussion on that topic.
  • Loading branch information
durden committed Jun 16, 2016
1 parent 62db30d commit 3e9d915
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pskb_website/templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
<meta property="og:type" content="article" />
<meta property="og:title" content="{{article.title}}" />
<meta property="og:url" content="{{canonical_url}}" />
<meta property="og:description" content="Guide related to {{article.stacks[0]}}" />

{% if article.stack_image_url %}
{% if article.stack_image_url and article.stack_image_url.endswith(('.png', '.jpg', '.jpeg')) %}
<meta property="og:image" content="{{article.stack_image_url}}" />
<meta property="og:image:width" content="400" />
<meta property="og:image:height" content="400" />
{% endif %}

{% endblock %}
Expand Down

0 comments on commit 3e9d915

Please sign in to comment.