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
PictureHtmlSupportBeforeProduceHtml
hook 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)
-
Add the following line to
LocalSettings.php
:wfLoadExtension( 'PictureHtmlSupport' );
-
Replace
includes/media/ThumbnailImage.php
(make a backup!) withincludes/ThumbnailImage.php
from this extension.