mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 20:51:50 +08:00
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:
parent
2d6fdf86f0
commit
9e8010df8b
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user