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:
David Taylor
2025-01-10 11:49:36 +00:00
committed by GitHub
parent 690ffcf1d5
commit ce97e51b63
6 changed files with 59 additions and 20 deletions

View File

@ -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