从 01 开始 从 01 开始
首页
  • 📚 计算机基础

    • 计算机简史
    • 数字电路
    • 计算机组成原理
    • 操作系统
    • Linux
    • 计算机网络
    • 数据库
    • 编程工具
    • 装机
  • 🎨 前端

    • Node
  • JavaSE
  • Java 高级
  • JavaEE

    • 构建、依赖管理
    • Ant
    • Maven
    • 日志框架
    • Junit
    • JDBC
    • XML-JSON
  • JavaWeb

    • 服务器软件
    • 环境管理和配置管理-科普篇
    • Servlet
  • Spring

    • Spring基础
  • 主流框架

    • Redis
    • Mybatis
    • Lucene
    • Elasticsearch
    • RabbitMQ
    • MyCat
    • Lombok
  • SpringMVC

    • SpringMVC 基础
  • SpringBoot

    • SpringBoot 基础
  • Windows 使用技巧
  • 手机相关技巧
  • 最全面的输入法教程
  • 最全面的浏览器教程
  • Office
  • 图片类工具
  • 效率类工具
  • 最全面的 RSS 教程
  • 码字工具
  • 各大平台
  • 校招
  • 五险一金
  • 职场规划
  • 关于离职
  • 杂谈
  • 自媒体
  • 📖 读书

    • 读书工具
    • 走进科学
  • 🌍 英语

    • 从零开始学英语
    • 英语兔的相关视频
    • Larry 想做技术大佬的相关视频
  • 🏛️ 政治

    • 反腐
    • GFW
    • 404 内容
    • 审查与自我审查
    • 互联网
    • 战争
    • 读书笔记
  • 💰 经济

    • 关于税
    • 理财
  • 💪 健身

    • 睡眠
    • 皮肤
    • 口腔健康
    • 学会呼吸
    • 健身日志
  • 🏠 其他

    • 驾驶技能
    • 租房与买房
    • 厨艺
  • 电影

    • 电影推荐
  • 电视剧
  • 漫画

    • 漫画软件
    • 漫画推荐
  • 游戏

    • Steam
    • 三国杀
    • 求生之路
  • 小说
  • 关于本站
  • 关于博主
  • 打赏
  • 网站动态
  • 友人帐
  • 从零开始搭建博客
  • 搭建邮件服务器
  • 本站分享
  • 🌈 生活

    • 2022
    • 2023
    • 2024
    • 2025
  • 📇 文章索引

    • 文章分类
    • 文章归档

晓林

程序猿,自由职业者,博主,英语爱好者,健身达人
首页
  • 📚 计算机基础

    • 计算机简史
    • 数字电路
    • 计算机组成原理
    • 操作系统
    • Linux
    • 计算机网络
    • 数据库
    • 编程工具
    • 装机
  • 🎨 前端

    • Node
  • JavaSE
  • Java 高级
  • JavaEE

    • 构建、依赖管理
    • Ant
    • Maven
    • 日志框架
    • Junit
    • JDBC
    • XML-JSON
  • JavaWeb

    • 服务器软件
    • 环境管理和配置管理-科普篇
    • Servlet
  • Spring

    • Spring基础
  • 主流框架

    • Redis
    • Mybatis
    • Lucene
    • Elasticsearch
    • RabbitMQ
    • MyCat
    • Lombok
  • SpringMVC

    • SpringMVC 基础
  • SpringBoot

    • SpringBoot 基础
  • Windows 使用技巧
  • 手机相关技巧
  • 最全面的输入法教程
  • 最全面的浏览器教程
  • Office
  • 图片类工具
  • 效率类工具
  • 最全面的 RSS 教程
  • 码字工具
  • 各大平台
  • 校招
  • 五险一金
  • 职场规划
  • 关于离职
  • 杂谈
  • 自媒体
  • 📖 读书

    • 读书工具
    • 走进科学
  • 🌍 英语

    • 从零开始学英语
    • 英语兔的相关视频
    • Larry 想做技术大佬的相关视频
  • 🏛️ 政治

    • 反腐
    • GFW
    • 404 内容
    • 审查与自我审查
    • 互联网
    • 战争
    • 读书笔记
  • 💰 经济

    • 关于税
    • 理财
  • 💪 健身

    • 睡眠
    • 皮肤
    • 口腔健康
    • 学会呼吸
    • 健身日志
  • 🏠 其他

    • 驾驶技能
    • 租房与买房
    • 厨艺
  • 电影

    • 电影推荐
  • 电视剧
  • 漫画

    • 漫画软件
    • 漫画推荐
  • 游戏

    • Steam
    • 三国杀
    • 求生之路
  • 小说
  • 关于本站
  • 关于博主
  • 打赏
  • 网站动态
  • 友人帐
  • 从零开始搭建博客
  • 搭建邮件服务器
  • 本站分享
  • 🌈 生活

    • 2022
    • 2023
    • 2024
    • 2025
  • 📇 文章索引

    • 文章分类
    • 文章归档
  • 计算机简史

  • 数字电路

  • 计算机组成原理

  • 操作系统

  • Linux

  • 计算机网络

  • 数据库

  • 编程工具

    • Git

      • 版本控制
      • 安装和配置 Git
      • 初识版本库
      • 版本管理
      • 工作区、暂存区和修改
      • 远程仓库
      • 解决 GitHub 访问失败的办法
      • 关于 GitHub 的奇技淫巧
      • 分支管理
      • GitStash
      • 远程仓库和分支
      • 标签管理
      • 自定义 Git
      • 使用可视化工具
      • Github Action
      • 常用 Git 命令
      • Git 帮助文档
      • GitHub 个人主页美化教程
        • 默认主页
        • 原理
        • 侧边栏
        • 新建仓库
        • 如何定制
        • 关于 Gitee
        • 最后
        • 参考
      • 其他 GitHub 技巧
      • 在 commit 里使用 emoji~
      • 逆天,CSDN 批量搬运 GitHub 项目
    • 终端

  • 装机

  • 计算机基础
  • 编程工具
  • Git
2024-05-19
目录

GitHub 个人主页美化教程

# 200.GitHub个人主页美化教程

Guthub 个人主页 (官方称呼是 profile)可以展示很多有用的信息,例如添加一个首页被访问次数的计数器,一个被 Star 与 Commit 的概览信息,以及各种技能标签,设备标签等,还可以利用 wakatime 显示你最近编码各类语言的使用时长,以及你最近 Steam 游戏游玩排行榜。

# 默认主页

默认情况下,GitHub 个人主页会显示其仓库信息、提交信息,例如 Linux 之父 Linus 的 GitHub 主页 (opens new window) 长这样:

​ ‍

但是,这个主页是可以定制的。GitHub 支持这个功能,并且有相关的文档说明:Setting up and managing your GitHub profile - GitHub Docs (opens new window)。

例如有的长这样:Luo Lei (opens new window)

​

这就远比默认主页好看不少,令人印象深刻。 ‍

# 原理

自定义主页很简单。我们首先在 GitHub 上新建一个仓库,仓库名和自己 Github 用户名相同,然后添加一个 README.md 自述文件,在该文件里添加信息即可。

例如,我创建的仓库:github.com/Peter-JXL/Peter-JXL (opens new window)

​

可以看到右上角有个提示:

Peter-JXL/Peter-JXL is a special repository.

Its README.md​ will appear on your public profile.

翻译:

这是一个特殊的仓库。

它的 README.md​ 会出现在你的首页中。 ‍

# 侧边栏

在讲解如何定制之前,我们先关注下左侧也有个人信息展示:

​

这个可以直接在个人首页上,点击左侧的 Edit profile 进行编辑:

​

可以修改名字、签名(Bio)、公司、地点、邮箱、网站.......... 按需修改即可。

​ ‍

接下来讲讲如何定制右侧。 ‍

# 新建仓库

新建一个同名仓库,并添加一个自述文件(README.md),确认:

​

GitHub 默认为此文件添加了一行字:

​

此时我们的首页也会跟着变:

​ ‍

# 如何定制

接下来,你就可以通过修改 README.md 来定制主页了。由于是 Markdown 文件,扩展性很高,并且全面支持 emoji。

此外,人的创造力有限,如何短时间内拥有一个酷炫的个人主页呢?

答案是 ctrl+c​,ctrl+v​。看到好看的模板,可以直接 fork,修改下相关变量即可。

此外 GitHub 上也有不少人收集优秀案例:

  • awesome-github-profile-readme (opens new window)
  • awesome-github-profiles (opens new window)
  • beautify-github-profile (opens new window)

接下来讲讲一些常见的信息展示。

# GitHub 统计卡片

官网:github.com/anuraghazra/github-readme-stats (opens new window)

效果:

​

使用方法很简单,将如下代码复制到你的 markdown 文件中,更改 ?username=​ 的值为你的 GitHub 用户名:

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

‍ 这个是默认样式,很简陋,可以配置显示图标、主题样式等,具体请看官网文档。

# GitHub 使用语言统计

官网:github.com/anuraghazra/github-readme-stats (opens new window)

效果:

​

使用方法同上,复制如下代码,更改 ?username=​ 的值:

![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)
1

‍ 同理,这个也可以配置主题和布局(参考文档)。 ‍

# Metrics 统计信息

会展示 GitHub 上的一些统计信息,效果:

​ ‍

我们可以去官网演示下:输入你的 GitHub 用户名,然后点击按钮:

​

PS:这个项目也是开源在 GitHub 上的:github.com/lowlighter/metrics (opens new window),并且还有其他的功能(后续会讲到)。

就能看到效果如下:

​

这个配置起来稍微复杂一点点。根据官网文档 (opens new window),使用该功能的方式之一是使用 GitHub Action。

首先我们得创建一个 GitHub personal token,位置:右上角个人头像 → settings → Developer settings → Personal access tokens:

​ ‍

接下来就是勾选 scopes(可以理解为权限,这个就根据不同插件的要求来勾选了,具体得看文档):

​

然后会生成 token,只展示一次,注意好好保管:

​ ‍

然后去到个人项目里的 settings 页面,将刚刚生成的 token 作为一个密钥(先创建一个环境,名字为 production;然后再创建一个名字为 METRICS_TOKEN 的 secret,值为刚刚生成的 token):

​

第三步,生成一个 Action,其实 metrics 已经帮我们生成了一个 Action:

​

内容如下(建议自行核对下,例如我这边在第 9 行加了个 environment 变量):

name: Metrics
on:
  # Schedule updates (each hour)
  schedule: [{cron: "0 * * * *"}]
  # Lines below let you run workflow manually and on each commit
  workflow_dispatch:
  push: {branches: ["master", "main"]}
jobs:
  github-metrics:
    runs-on: ubuntu-latest
    environment: 
      name: production
    permissions:
      contents: write
    steps:
      - uses: lowlighter/metrics@latest
        with:
          # Your GitHub token
          # The following scopes are required:
          #  - public_access (default scope)
          # The following additional scopes may be required:
          #  - read:org      (for organization related metrics)
          #  - read:user     (for user related data)
          #  - read:packages (for some packages related data)
          #  - repo          (optional, if you want to include private repositories)
          token: ${{ secrets.METRICS_TOKEN }}

          # Options
          user: Peter-JXL
          template: classic
          base: header, activity, community, repositories, metadata
          config_timezone: Asia/Shanghai
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

‍ 等我们提交后,就会自动生成一个 svg 文件:

​

然后我们在自述文件里添加这个图片,例如 Markdown 格式如下(其实也可以用 HTML 格式,更灵活):

![Metrics](/github-metrics.svg)
1

‍ 此时的首页效果:

​

# GitHub 资料奖杯

官网:github.com/ryo-ma/github-profile-trophy (opens new window)

效果:

​

使用方法同上,复制如下代码,更改 ?username=​ 的值:

![trophy](https://github-profile-trophy.vercel.app/?username=ryo-ma)
1

‍ 同理,这个也可以配置主题。

# GitHub 徽章

为你的开源项目生成高质量小徽章图标,直接复制链接使用。

官网:Shields.io (opens new window)

效果:

​ ‍

示例代码:

<img src="https://img.shields.io/badge/-HTML5-E34F26?style=flat-square&logo=html5&logoColor=white" /> 
<img src="https://img.shields.io/badge/-CSS3-1572B6?style=flat-square&logo=css3" /> 
<img src="https://img.shields.io/badge/-JavaScript-oringe?style=flat-square&logo=javascript" />
1
2
3

‍

# GitHub 访客徽章

这个徽章会实时改变,记录此页面被访问的次数。

官网:visitor-badge.glitch.me (opens new window)

效果:​​

使用方法:复制如下代码到 Markdown 并替换 page_id​ 的值为用户名

![visitors](https://visitor-badge.glitch.me/badge?page_id=page.id&left_color=green&right_color=red)
1

可以配置颜色,参数为:left_color,right_color ‍

# GitHub 活动统计图

动态生成的活动图,用于显示您过去 31 天的 GitHub 活动。

官网:github.com/Ashutosh00710/github-readme-activity-graph (opens new window)

效果:

​

使用方法同上,复制如下代码,更改 ?username=​ 的值:

![Ashutosh's github activity graph](https://github-readme-activity-graph.vercel.app/graph?username=Ashutosh00710)
1

可以配置主题。

# 修仙系列统计卡片

一个以凡人修仙传境界为基础的 Github 统计卡片。等级分为:['道祖', '大罗', '太乙', '金仙', '真仙', '大乘', '合体', '炼虚', '化神', '元婴', '金丹', '筑基', '练气'],对应区间:[1, 5, 10, 15, 20, 30,40,50,60, 70, 80, 90, 100]。

官网:IceEnd/github-immortality (opens new window)

效果:

​ ‍

使用方法同上,复制如下代码,更改 ?username=​ 的值:

![IceEnd's GitHub stats](https://github-immortality.vercel.app/api?username=iceend)
1

# GitHub 连续打卡

在 README 中展示您连续提交代码的次数。

官网:github.com/DenverCoder1/github-readme-streak-stats (opens new window)

效果:

​ ‍

使用方法同上,复制如下代码,更改 ?username=​ 的值:

![GitHub Streak](https://streak-stats.demolab.com/?user=DenverCoder1)
1

同理,支持主题、样式等配置。

# 社交统计

在 README 中展示你在一些流行的网站的数据,例如知乎,GitHub,B 站,LeetCode,掘金,CSDN,牛客。

官网:github.com/songquanpeng/stats-cards (opens new window)

效果:

​ ‍

使用方法:复制代码到 Markdown 并替换 username 的值为那个网站的用户名

![](https://stats.justsong.cn/api/leetcode?username=quanpeng&cn=true)
1

# 打字特效

让内容通过打字的特效来展示,炫酷。

官网:github.com/DenverCoder1/readme-typing-svg (opens new window)

效果:

​ ‍

使用方法:复制代码到 Markdown 并替换 ?lines=​ 的值为你想要的内容,字与字之间用分号隔开

![Typing SVG](https://readme-typing-svg.demolab.com/?lines=First+line+of+text;Second+line+of+text)
1

更多配置参考官网文档。还可以去 demo (opens new window) 站里自行调试:

​ ‍

# 贪吃蛇

默认的提交信息是这样子的:

​

而我们可以将其变成一个动画:一只贪吃蛇挨个吃掉图里的绿点:

github-contribution-grid-snake​

使用起来也不难,先新建一个 workflow 文件(名字随意),不需要任何改动,然后提交:

name: generate animation

on:
  # run automatically every 2 hours
  schedule:
    - cron: "0 */2 * * *" 
  
  # allows to manually run the job at any time
  workflow_dispatch:
  
  # run on every push on the master branch
  push:
    branches:
    - master
  
  

jobs:
  generate:
    permissions: 
      contents: write
    runs-on: ubuntu-latest
    timeout-minutes: 5
  
    steps:
      # generates a snake game from a github user (<github_user_name>) contributions graph, output a svg animation at <svg_out_path>
      - name: generate github-contribution-grid-snake.svg
        uses: Platane/snk/svg-only@v3
        with:
          github_user_name: ${{ github.repository_owner }}
          outputs: |
            dist/github-contribution-grid-snake.svg
            dist/github-contribution-grid-snake-dark.svg?palette=github-dark
  
  
      # push the content of <build_dir> to a branch
      # the content will be available at https://raw.githubusercontent.com/<github_user>/<repository>/<target_branch>/<file> , or as github page
      - name: push github-contribution-grid-snake.svg to the output branch
        uses: crazy-max/ghaction-github-pages@v3.1.0
        with:
          target_branch: output
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

‍ 将下列代码复制到 Markdown 内,将用户名部分替换成你自己的,并提交。

这段代码的目的是:加载贪吃蛇动画,且贪吃蛇的暗亮风格与你的 Github 的暗亮风格进行自动适配。

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Peter-JXL/Peter-JXL/output/github-contribution-grid-snake-dark.svg">
  <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Peter-JXL/Peter-JXL/output/github-contribution-grid-snake.svg">
  <img alt="github contribution grid snake animation" src="https://raw.githubusercontent.com/Peter-JXL/Peter-JXL/output/github-contribution-grid-snake.svg">
</picture>
1
2
3
4
5

‍ 之前我们设置的是每隔 2 小时更新一次,我们可以先手动跑一次。点击 generate animation​,点击 Run workflow​:

​ ‍

稍等片刻,显示运行成功,再次回到仓库主页就会看到贪吃蛇动画已被加载:

​

# 博客文章同步

如果你有博客网站,且网站带有 RSS 功能,就可以配置此功能,它能在你的 GitHub 首页上显示最近更新的博客

原理:利用 blog-post-workflow (opens new window) 在自述文件上展示最近几篇博客文章。

效果:

​

使用起来也很简单。首先创建一个 workflow(例如 blog-post-workflow.yml​ ),需要改动最后一行的 feed_list​ 的内容为你自己网站的 RSS 链接。

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 */2 * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the GitHub Actions Workflow page directly
permissions:
  contents: write # To write the generated contents to the readme

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Pull in blog's posts
        uses: gautamkrishnar/blog-post-workflow@v1
        with:
          feed_list: "https://www.peterjxl.com/rss.xml"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

更多构建参数请参考 🔗 github.com/gautamkrishnar/blog-post-workflow (opens new window),包括显示文章数量、显示主题等等。

然后在自述文件输入这些内容,程序会自动抓取文章标题、链接等并替换这两个注释:

📕 &nbsp;**Latest Blog Posts**
<!-- BLOG-POST-LIST:START -->
<!-- BLOG-POST-LIST:END -->
1
2
3

同理,此时是看不到文章列表的,我们得先手工运行一次 action:

​

# GitHub 3D 统计

使用 3D 图来展示信息。

官网:github.com/yoshi389111/github-profile-3d-contrib (opens new window)

效果:

​

使用方法和之前的类似。

首先创建文件 .github/workflows/profile-3d.yml​,内容如下:

name: GitHub-Profile-3D-Contrib

on:
  schedule: # 03:00 JST == 18:00 UTC
    - cron: "0 18 * * *"
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    name: generate-github-profile-3d-contrib
    steps:
      - uses: actions/checkout@v3
      - uses: yoshi389111/github-profile-3d-contrib@0.7.1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          USERNAME: ${{ github.repository_owner }}
      - name: Commit & Push
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add -A .
          git commit -m "generated"
          git push
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

‍ 然后手动执行一次 action:Actions​ -> GitHub-Profile-3D-Contrib​ -> Run workflow​

然后会生成这些文件(带路径,各种主题的都有):

  • profile-3d-contrib/profile-green-animate.svg​
  • profile-3d-contrib/profile-green.svg​
  • profile-3d-contrib/profile-season-animate.svg​
  • profile-3d-contrib/profile-season.svg​
  • profile-3d-contrib/profile-south-season-animate.svg​
  • profile-3d-contrib/profile-south-season.svg​
  • profile-3d-contrib/profile-night-view.svg​
  • profile-3d-contrib/profile-night-green.svg​
  • profile-3d-contrib/profile-night-rainbow.svg​
  • profile-3d-contrib/profile-gitblock.svg​ ‍ 最后在 Markdown 里添加即可。 ‍ PS,如果遇到了这样的报错:
remote: Permission to mthsBelloni/mthsBelloni.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/Peter-JXL/Peter-JXL/': The requested URL returned error: 403
Error: Process completed with exit code 128.
1
2
3

‍ 大概率是因为没有配置 actions 的写权限,导致无​法写入 svg 文件。解决办法:加上权限

​

# Profile 编辑器

这个项目是一个是一个可视化 profile 生成工具,使用者无需学习 Markdown 语法,仅需要在对应窗口中输入或者选择相应的内容,工具会自动生成 Markdown 脚本。脚本编辑完成以后,直接复制粘贴到自己的 Github 即可。

官网:profilinator.rishav.dev (opens new window)

效果:

​

# 关于 Gitee

很遗憾,Gitee,号称国内版的 GitHub,并没有提供类似的功能。但我们可以完善下个人信息部分:

​

方法:在个人主页里打开个人设置

​ ‍

打开个人资料,可以修改公司,职务,微信,QQ,领英,微博,博客,所在地,自我介绍等信息,多多少少能优化下个人主页:

​

例如鱼皮的长这样:

​

# 最后

本文仅仅列出一些常见的功能,感兴趣的同学可以自行搜索更多功能,甚至自定义。

这是我的 GitHub 主页,大家可以抄抄作业(如果能点个 star 就更好了):https://github.com/Peter-JXL (opens new window)

特别注意:由于 GFW 的原因,可能需要特殊上网后才能看到一些内容。

最后,祝你玩得开心!

# 参考

Github 首页美化教程(一):打造个性化的 GitHub 首页 - 知乎 (opens new window)

美化自己的 GitHub 个人主页 - 0x5E (opens new window)

Github 自定义个人首页_github 主页搭建-CSDN 博客 (opens new window)

上次更新: 2025/6/3 17:50:46
Git 帮助文档
其他 GitHub 技巧

← Git 帮助文档 其他 GitHub 技巧→

最近更新
01
语雀文档一键下载至本地教程
07-04
02
要成功,就不要低估环境对你的影响
07-03
03
血泪教训:电子设备要定期开机
07-02
更多文章>
Theme by Vdoing | Copyright © 2022-2025 | 粤 ICP 备 2022067627 号 -1 | 粤公网安备 44011302003646 号 | 点击查看十年之约
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式