Sphinx Extension to enable OGP support
Project description
sphinxext-opengraph
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.
- 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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for sphinxext-opengraph-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea5cc164da69c0f6c55e8d8ee7a7b2d9e727b36ef2d2a90cba46172cf4407c08 |
|
MD5 | 8b8efc835c9cf5fbeb59c7f0ddda71c9 |
|
BLAKE2b-256 | dbc049c1b2a8946da953eeb5aec9c13a3834d6e1d01121add66fdc68675459c0 |
Close
Hashes for sphinxext_opengraph-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25000292fae866b1b3ae143e85ec179b2b3374d5bf380578b89ac47730c5a095 |
|
MD5 | a50fbbf35f3a963cc54f02ac66a38a2b |
|
BLAKE2b-256 | 40978c199a54c459c8d0c905217d784de88b0e6da43efb7d8acbb98301a3260f |