pkgdown site - twitter card image not showing

I'm trying to get the twitter card for my packages' pkgdown site to work (https://teebusch.github.io/noah/) to work, but the image isn't showing. I'm using the official Twitter card validator to test it.

First, I've used an empty _pkgdown.yml - no twitter card was created at all (Shouldn't there be a default?).

Then I've used this _pkgdown.yml, based on this vignette:

home:
  title: Unique Pseudonymous Animal Names in R
  description: >
    Create pseudonymous animal names that are delightful and memorable 
    like the Likable Leech and the Proud Chickadee.

template:
  opengraph:
    twitter:
      creator: "@tobilottii"
      card: summary_large_image

The correct package description is shown by the card validator, but the image is missing.

It seems like the appropriate meta tags are created in index.html:

<meta property="og:image" content="/logo.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@tobilottii">
<meta name="twitter:site" content="@tobilottii"> 

and the image logo.png is in the root directory of the site, too.

I've looked into the _pkgdown.yml of other packages with working twitter cards, and couldn't find any that even use the template: opengraph ... stuff.

What am I missing?

Can you try adding

url: https://teebusch.github.io/noah/

to your pkgdown configuration? I haven't tested that it will fix your issue, just hope it will, and in any case it's important to add this field now that your pkgdown website is deployed.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

That works! Thanks a lot!

1 Like