codestats-readme/readme_cn.md
2020-07-19 12:00:32 +08:00

8.5 KiB
Raw Blame History

Github Readme Stats

GitHub Readme Stats

在你的 README 中 获取动态生成的GitHub统计信息

Tests Passing Issues GitHub pull requests

查看 Demo · 报告 bug · 请求增加功能

喜欢这个项目? 请考虑捐赠来帮助它完善!

特性

GitHub 统计卡片

将这复制到你的 markdown 中,就这样,非常简单! 更改 ?username= 的值为你的用户名。

[![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)

Note: 排名是基于用户的统计信息计算得出的,详见 src/calculateRank.js

隐藏个人统计信息

想要隐藏某个统计信息, 你可以传递参数 ?hide=,并将你想要隐藏的项目用数组进行传递。

选项: &hide=["stars","prs","issues","contribs"]

![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide=["contribs","prs"])

显示图标

想要显示图标, 你可以传递 show_icons=true,像这样:

![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true)

自定义

你可以为你的 Stats CardRepo Card 自定义样式however you want with URL params.

自定义选项:

Option type description Stats Card (default) Repo Card (default)
title_color hex color title color 2f80ed 2f80ed
text_color hex color body color 333 333
icon_color hex color icon color 4c71f2 586069
bg_color hex color card bg color FFFEFE FFFEFE
line_height number control the line-height between text 30 N/A
hide_rank boolean hides the ranking false N/A
hide_title boolean hides the stats title false N/A
hide_border boolean hides the stats card border false N/A
show_owner boolean shows owner name in repo card N/A false
show_icons boolean shows icons false N/A
  • 你也可以通过自定义来兼容暗黑模式
![Anurag's github stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=fff&icon_color=79ff97&text_color=9f9f9f&bg_color=151515)

Demo

  • 默认

Anurag's github stats

  • 隐藏某个项目

Anurag's github stats

  • 显示图标

Anurag's github stats

  • 自定义添加卡片

Anurag's github stats

  • 自定义仓库卡片

Customized Card

GitHub Extra Pins

GitHub extra pins allow you to pin more than 6 repositories in your profile using a GitHub readme profile.

Yey! You are no longer limited to 6 pinned repositories.

Usage

Copy-paste this code into your readme and change the links.

Endpoint: api/pin?username=anuraghazra&repo=github-readme-stats

[![ReadMe Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)

Demo

ReadMe Card

Use show_owner variable to include the repo's owner username

ReadMe Card

提示 (Align The Repo Cards)

你通常无法将图片靠边显示,为此,您可以使用以下方法:

<a href="https://github.com/anuraghazra/github-readme-stats">
  <img align="left" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
<a href="https://github.com/anuraghazra/convoychat">
  <img align="left" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
</a>

自己部署

自从 GitHub 的 API 每个小时只允许 5 千的请求,我都 https://github-readme-stats.vercel.app/api 很有可能会触发限制 如果你将其托管在自己的 Vercel 服务商,那么你就不用担心任何事了。点击 deploy 按钮来开始

注意: 从 #58 开始,我们应该能够处理超过 5千 的请求,并且不会出现宕机问题 :D

Deploy to Vercel

Guide on setting up Vercel
  1. 前往 vercel.com
  2. 点击 Log in
  3. 点击 Continue with GitHub 通过 GitHub 进行登录
  4. 登录 GitHub 并允许访问所有存储库(如果系统提示)
  5. Fork 这个仓库
  6. 返回到你的 Vercel dashboard
  7. 选择 Import Project
  8. 选择 Import Git Repository
  9. 选择 root 并将所有内容保持不变,并且只需添加名为 PAT_1 的环境变量如图所示其中将包含一个个人访问令牌PAT你可以在这里轻松创建(保留默认,并且只需要命名下,名字随便)
  10. 点击 deploy, 这就完成了,查看你的域名就可使用 API 了!

💖 支持这个项目

我几乎将我所能的进行开源,并且我试着回复每个在使用这些项目时需要帮助的人。很明显,这需要时间,但你可以免费享受此服务。

然而, 如果你正在使用这个项目并且感觉挺开心或者只是想要支持我继续开发,这里有一些方法:

  • 在你的 README 中使用 github-readme-stats 时,链接指向会这里 :D
  • Star 并 分享这个项目 🚀
  • paypal.me/anuraghazra - 你可以通过 PayPal 一次性捐款. 我可能会买一杯咖啡茶. 🍵

谢谢! ❤️


欢迎贡献! <3

❤️ 发电,用 JavaScript 制作。