Open WeetHet opened 5 months ago
- Should this be an API for extensions?
I think for now it's fine to keep it in there, since it's similar to the permalinks behavior we have.
- Should we make a
Commit
/Author
/User
/... struct for each hosting separately or extract them? For now I've extracted theAuthor
struct as it's the only one that is built by hand and not deserialised from the response.
I don't think we need more than a URL right now. Once we need more, we can add more.
- Should this be an API for extensions?
I think for now it's fine to keep it in there, since it's similar to the permalinks behavior we have.
- Should we make a
Commit
/Author
/User
/... struct for each hosting separately or extract them? For now I've extracted theAuthor
struct as it's the only one that is built by hand and not deserialised from the response.I don't think we need more than a URL right now. Once we need more, we can add more.
Okay, I'll undraft the PR and we'll go from there
The Gitee
host need access_token
after you can send request fetch avatar
So the user may need to fill it in manually, this is a setting item 🤔
API: https://gitee.com/api/v5/swagger#/getV5ReposOwnerRepoCommitsSha
function createURL(owner: string, repo: string, sha: string, token: string) {
return `https://gitee.com/api/v5/repos/${owner}/${repo}/commits/${sha}?access_token=${token}`
}
const token = Bun.env["ACCESS_TOKEN"]!
const url = createURL('libkitten', 'zed', 'f72cf2afe34f77bf498454cd5486aa2c31b820d6', token)
console.log(url)
// export ACCESS_TOKEN=$$$
// bun run run.ts | xargs curl | jless
Avatar is author.avatar_url
At present, it seems that it does not support setting the image size
Currently, only GitHub avatars are supported in git blame. Other hostings should be supported as well.
Avatar support
Questions
Commit
/Author
/User
/... struct for each hosting separately or extract them? For now I've extracted theAuthor
struct as it's the only one that is built by hand and not deserialised from the response.