Skip to main content

Sphinx Extension to enable OGP support

Project description

sphinxext-opengraph

Build

Sphinx extension to generate OpenGraph metadata (https://ogp.me/)

Installation

python -m pip install sphinxext-opengraph

Options

These values are placed in the conf.py of your sphinx project.

  • ogp_site_url
    • This config option is very important, set it to the URL the site is being hosted on.
  • ogp_description_length
    • Configure the amount of characters taken from a page. The default of 200 is probably good for most people. If something other than a number is used, it defaults back to 200.
  • ogp_site_name
    • This is not required. Name of the site. This is displayed above the title.
  • ogp_image
    • This is not required. Link to image to show.
  • ogp_type
    • This sets the ogp type attribute, for more information on the types available please take a look at https://ogp.me/#types. By default it is set to website, which should be fine for most use cases.

Example Config

Simple Config

ogp_site_url = "http://example.org/"
ogp_image = "http://example.org/image.png"

Advanced Config

ogp_site_url = "http://example.org/"
ogp_image = "http://example.org/image.png"
ogp_description_length = 300
ogp_type = "article"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxext-opengraph-0.2.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

sphinxext_opengraph-0.2.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page