前段時間 GitHub 出了一個功能,可以定制自己的 GitHub 首頁。比如我的首頁 https://github.com/polaris1119 之前是這樣的:
定制後是這樣的:看着很“高端”吧。
現在就給大家講一下怎麼做到的。
1、建立一個同名倉庫
新建立一個和 GitHub 賬号同名的 repository(倉庫),比如我的賬号是 polaris1119,是以建立這個倉庫:https://github.com/polaris1119/polaris1119。
官方提示:
polaris1119/polaris1119 is a special repository. Its README.md
will appear on your public profile!
2、編輯該倉庫的 README.md 檔案
在該檔案最頂部增加如下内容(該檔案預設有的内容可以不用管),相應部分需要修改為你的:
<img src="https://github-readme-stats.vercel.app/api?username=polaris1119&show_icons=true" alt="logo" height="160" align="right" style="margin: 5px; margin-bottom: 20px;" />
### I'm polarisxu
- ???? Peking university
- ???? [studygolang.com](https://studygolang.com) 站長.
- ???? [《Go語言程式設計之旅:一起用Go做項目》](https://u.jd.com/RMSbOS)合著者.
- ???? 開源圖書:[《Go語言标準庫》](https://github.com/polaris1119/The-Golang-Standard-Library-by-Example).
- ???? GCTT、golangweekly 等倉庫發起人.
- 公衆号:polarisxu
<img src="https://github-profile-trophy.vercel.app/?username=polaris1119&theme=flat&column=7" alt="logo" height="160" align="center" style="margin: auto; margin-bottom: 20px;" />
對這三部分内容進行簡單說明:
- 頂部的 img 标簽,顯示為一張圖檔,控制的是我首頁上面右邊的圖:polarisxu’s GitHub Stats;其中
改為你的 username 即可;username=polaris1119
- 中間的文字,一般寫上你的一些介紹,主要成就或項目等,随意發揮;
- 底部的 img 标簽,顯示為一張圖檔,控制的是我首頁下邊的“獎杯”圖檔;其中
username=polaris1119
儲存,回到你的 GitHub 首頁,有驚喜沒?!對比一下别人的,有沒有要更多貢獻開源的沖動?!
總結
沒有統計這個過程是不是 2 分鐘能搞定,但我覺得差不多吧。如果對上面兩張圖是怎麼實作的感興趣,自己去摸索吧。