Skip to content

Question: trying to get social cards to work properly #119

@lwasser

Description

@lwasser

Hi there - i am struggling to get social cards to work as i'd like them too. but i did see this issue and pr from @choldgraf that seems to do exactly what I want!

At the top of my sphinx book i have this:

---
:og:description: Learn how to setup and run tests for your Python package locally on your computer using automation tools such as Nox. Also learn about other tools that scientific Python community members use to run tests.
:og:image: https://www.pyopensci.org/python-package-guide/_images/packaging-lifecycle.png
:og:image:alt: An image showing the Python packaging lifecycle
:og:title: Sdf
---

here is a PR with that metadata added to a page. note locally when i build the page i don't see any of the info actually updated as i would expect it to.

Here in the preview you can see from that PR. Notce that the updated metadata for the page is not being recognized by opengraph.
the previews seem to have the info from my conf.py (our logo but not the titel and decription from the page metadata that i added.

# Social cards
ogp_site_url = "http://www.pyopensci.org/python-package-guide"
ogp_image = "https://www.pyopensci.org/python-package-guide/_static/logo-light-mode.png"
Screenshot 2024-01-10 at 10 26 59 AM

I'm curious if you can help me understand what i'm doing wrong with this extension and how i can make better cards with a custom description and title if i want those elements to be custom. And with an image that only takes up a part of the card which is what i saw in Chris' pr linked above.

Thank you for any help / guidance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions