Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Sphinx extension to generate Open Graph metadata for each page of your documentation.
python -m pip install sphinxext-opengraph
Just add sphinxext.opengraph
to your extensions list in your conf.py
extensions = [
"sphinxext.opengraph",
]
These values are placed in the conf.py
of your Sphinx project.
Users hosting documentation on Read The Docs do not need to set any of the following unless custom configuration is wanted. The extension will automatically retrieve your site URL.
ogp_site_url
ogp_description_length
ogp_site_name
project
config value. Set to False
to unset and use no default.ogp_social_cards
ogp_image
ogp_site_url
.ogp_image_alt
ogp_site_name
or the document's title as alt text, if available. Set to False
if you want to turn off alt text completely.ogp_use_first_image
True
to use each page's first image, if available. If set to True
but no image is found, Sphinx will use ogp_image
instead.ogp_type
website
, which should be fine for most use cases.ogp_custom_meta_tags
ogp_enable_meta_description
True
, generates <meta name="description" content="...">
from the page.ogp_site_url = "http://example.org/"
ogp_image = "http://example.org/image.png"
ogp_site_url = "http://example.org/"
ogp_image = "http://example.org/image.png"
ogp_description_length = 300
ogp_type = "article"
ogp_custom_meta_tags = [
'<meta property="og:ignore_canonical" content="true" />',
]
ogp_enable_meta_description = True
Field lists are used to allow you to override certain settings on each page and set unsupported arbitrary Open Graph tags.
Make sure you place the fields at the very start of the document such that Sphinx will pick them up and also won't build them into the html.
These are some overrides that can be used on individual pages, you can actually override any tag and field lists will always take priority.
:ogp_description_length:
ogp_description_length
.1:ogp_disable:
:og:description:
:description:
or .. meta::\n :description:
<meta name="description" content="...">
description.:og:title:
:og:type:
:og:image:
:og:image:alt:
Remember that the fields must be placed at the very start of the file. You can verify Sphinx has picked up the fields if they aren't shown in the final html file.
:og:description: New description
:og:image: http://example.org/image.png
:og:image:alt: Example Image
Page contents
=============
Additionally, you can use field lists to add any arbitrary Open Graph tag not supported by the extension. The syntax for arbitrary tags is the same with :og:tag: content
. For example:
:og:video: http://example.org/video.mp4
Page contents
=============
FAQs
Sphinx Extension to enable OGP support
We found that sphinxext-opengraph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.