I'm trying to add Twitter Cards to my site so that tweets referencing my blog posts will be expandable and show extra info. I've installed the metatag module, enabled the Metatag: Twitter Cards sub-module as well as patched the Twitter Cards sub-module to fix a problem with it generating
<link /> tags instead of
<meta /> tags.
When I include a twitter:image tag, the Twitter Card fails, but when I remove it, it works just fine. What am I doing wrong?
<meta property="twitter:url" content="http://liberalgeek.com/content/why-do-atheists-celebrate-christmas" /> <meta property="twitter:card" content="summary" /> <meta property="twitter:description" content="I can't speak for all atheists, I can only speak for myself, so please leave a comment below and explain why you celebrate Christmas! When I hear someone ask, "Why do atheists celebrate Christmas?" my first thought often is: Better Question: Why do Christians celebrate Christmas?" /> <meta property="twitter:creator" content="@kennywyland" /> <meta property="twitter:title" content="Why do Atheists celebrate Christmas?" /> <!-- the following line causes the problem --> <meta property="twitter:image" content="http://liberalgeek.com/sites/default/files/styles/large/public/Christmas%20Tree.jpg" />
I have tried
<meta property= as well as
<meta name= and they behave the same way.
The image is publicly visible, it's large enough without being too large... what is wrong?
To be clearer, by "failing" I mean that Twitter refuses to acknowledge there is a Twitter Card for that URL, so the preview is not shown along with the tweet. When I test this on the twitter card preview page, this is the result I get:
However, when I remove the
twitter:image tag and generate the preview again it works just fine and looks like this:
During further testing I found the STRANGEST thing. If I change the domain from liberalgeek.com to www.liberalgeek.com, the Twitter Card successfully generates, although the thumbnail image is a broken image. (That may just be due to high twitter volume, but I'm not sure.)
I want the Twitter card to work, even if they don't include the unnecessary www.
- The .htaccess file is the standard one installed with Drupal
- I don't think I'm using gzip compression
- Apache isn't sending back the wrong headers
- The error log doesn't shown any error
- The access log shows entries with a return code equal to 200, and a correct content length value, when Twitter tries to access the image
I found a site on my server which twitter handles just fine:
<meta property="twitter:image" content="http://www.geekqi.com/images/StylizedYinYangRedLucida.png" />
But I'm not sure what the difference is between this and all of my other sites.