Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.