DEV: Use thumbnail url for wikimedia onebox image (#22620)

Wikimedia provides a thumbnail url for its images, so we should use that
for oneboxes instead of the full-size image. Because the size of the
  onebox image we display is quite small anyways the thumbnail wikimedia
  provides should suffice and will save bandwidth.

See: https://meta.discourse.org/t/264039
This commit is contained in:
Blake Erickson 2023-07-14 12:20:18 -06:00 committed by GitHub
parent 2d6fdf86f0
commit 9e8010df8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1,3 +1,3 @@
{{#image}}<img src="{{image}}" class="thumbnail">{{/image}}
{{#image}}<img src="{{thumbnail}}" class="thumbnail">{{/image}}
<h3><a href="{{link}}" target="_blank" rel="noopener">{{title}}</a></h3>

View File

@ -19,7 +19,7 @@ RSpec.describe Onebox::Engine::WikimediaOnebox do
it "has the image" do
expect(html).to include(
"https://upload.wikimedia.org/wikipedia/commons/a/af/Stones_members_montage2.jpg",
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Stones_members_montage2.jpg/500px-Stones_members_montage2.jpg",
)
end
end