Template:TopicBiblioRow: Difference between revisions
(VSCode edit) |
(VSCode edit) |
||
| Line 16: | Line 16: | ||
AssociatedArticle, so nothing needs storing on the article itself. | AssociatedArticle, so nothing needs storing on the article itself. | ||
The cover is requested at | The cover is requested at 250px, which is larger than the 42px slot it sits | ||
in while collapsed. That is deliberate — opening the description grows the | in while collapsed. That is deliberate — opening the description grows the | ||
cover to 120px, and on a 2x display that needs 240px of real pixels. Without | cover to 120px, and on a 2x display that needs 240px of real pixels. Without | ||
an explicit size MediaWiki would serve the original file instead, which on a | an explicit size MediaWiki would serve the original file instead, which on a | ||
long list means megabytes of images scaled down by the browser. | long list means megabytes of images scaled down by the browser. | ||
250 rather than a round 260: the Commons scaler fails for exactly the 260px | |||
bucket on a subset of files (20 of 298 covers, deterministic on retry) and | |||
returns no thumbnail, so the image degrades to a plain link to the file | |||
page. Every other width tested from 100 to 500 works, 250 and 270 included. | |||
If covers ever render as links again, probe a few widths before suspecting | |||
the file, the ForeignFileRepo, or this template. | |||
-->{{#if: {{{ FrontCoverImg | }}} | -->{{#if: {{{ FrontCoverImg | }}} | ||
|<div class="topic-biblio-thumb">[[File:{{PAGENAME:{{{ FrontCoverImg | }}}}}| | |<div class="topic-biblio-thumb">[[File:{{PAGENAME:{{{ FrontCoverImg | }}}}}|250px|link={{{ 1 | }}}|class=object-fit-cover w-100 h-100]]</div> | ||
|<div class="topic-biblio-thumb topic-biblio-thumb-empty"></div> | |<div class="topic-biblio-thumb topic-biblio-thumb-empty"></div> | ||
}} | }} | ||
Revision as of 20:32, 24 August 2026
Renders one row of the bibliographic list on a topic page.
Called by Template:TopicBiblioSection with named args=yes, so the
printout names in that query must match the parameter names used here.