starcitizenwiki / picture-html-support
A MediaWiki extension that wraps thumbnails with picture elements, and allows adding additional source elements
Installs: 837
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 4
Type:mediawiki-extension
pkg:composer/starcitizenwiki/picture-html-support
Requires (Dev)
This package is auto-updated.
Last update: 2025-10-15 02:21:08 UTC
README
The PictureHtmlSupport enhances MediaWiki thumbnails on wiki page with <picture> elements. It does these things:
- Wrap thumbnail
<img>element with<picture>element - Move resposive image definition to
<source>element if enabled - Introduce the
PictureHtmlSupportBeforeProduceHtmlhook for users to add additional<source>elements - Add a hidden
<a>element next to the thumbnail HTML so web crawlers can crawl the original resolution image (https://phabricator.wikimedia.org/T54647)
Installation
-
Add the following line to
LocalSettings.php:wfLoadExtension( 'PictureHtmlSupport' );
-
Replace
includes/media/ThumbnailImage.php(make a backup!) withincludes/ThumbnailImage.phpfrom this extension.