mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
UX: Improve git blob oneboxes (#30694)
Rearranges the info at the top of github/gitlab 'blob' oneboxes to make them easier to read
This commit is contained in:
@ -35,13 +35,15 @@ module Onebox
|
||||
"https://raw.githubusercontent.com/#{match[:org]}/#{match[:repo]}/#{match[:sha1]}/#{match[:file]}"
|
||||
end
|
||||
|
||||
def title
|
||||
Sanitize.fragment(Onebox::Helpers.uri_unencode(link).sub(%r{^https?\://github\.com/}, ""))
|
||||
end
|
||||
|
||||
def auth_headers(match)
|
||||
github_auth_header(match[:org])
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def data
|
||||
super.merge({ domain: "github.com/#{match[:org]}/#{match[:repo]}" })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user