-
Notifications
You must be signed in to change notification settings - Fork 40
Feat: 增加了贡献者的功能 #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: 增加了贡献者的功能 #64
Conversation
|
@Crokily is attempting to deploy a commit to the longsizhuo's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a contributors feature that displays GitHub contributors for each documentation page, along with some style adjustments. The feature fetches contributor data from the GitHub API and renders it at the bottom of doc pages.
- Added GitHub API integration to fetch contributors by file path
- Created a Contributors component to display contributor avatars and names
- Removed global CSS rules that forced all rounded corners to be square
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/github.ts | New GitHub API client with caching for fetching contributors |
| app/components/Contributors.tsx | New component to render contributor list with avatars |
| app/docs/[...slug]/page.tsx | Integration of contributors feature into doc pages |
| app/globals.css | Removed global rounded corner override styles |
| .env.sample | Added sample environment variable for GitHub token |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
#62
效果:
改动内容:
lib下加了个github.ts用于获取贡献者数据,该接口需要配置一个github账号的personal access token 在环境变量(GITHUB_TOKEN=github_pat_xxxxxxxxxxxxxx)里,需要 @longsizhuo 在vercel里配置一下,增加了一个.env.sapmle用于指示
然后添加了一个contributors组件,即该贡献者组件,该组件在未获取到贡献者数据时不会显示在页内,因此在接口异常时不会对页面造成影响
破坏性改动:
global.css中之前被配置了清除所有圆角样式的代码,这段代码会强制影响后续所有圆形组件,不建议这么使用,删去了这段代码,然后页内出现了一些纯矩形和带圆角的组件,因此后续需要团队讨论统一样式设计,是有圆角设计,还是纯矩形,再另开分支处理。