mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:59:39 +08:00
23 lines
471 B
Ruby
23 lines
471 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Onebox
|
|
module Engine
|
|
class FiveHundredPxOnebox
|
|
include Engine
|
|
include StandardEmbed
|
|
|
|
matches_domain("500px.com")
|
|
always_https
|
|
|
|
def self.matches_path(path)
|
|
path.match?(%r{^/photo/\d+/})
|
|
end
|
|
|
|
def to_html
|
|
og = get_opengraph
|
|
"<img src='#{og.image}' width='#{og.image_width}' height='#{og.image_height}' class='onebox' #{og.title_attr}>"
|
|
end
|
|
end
|
|
end
|
|
end
|