惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
F
Fortinet All Blogs
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
Y
Y Combinator Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
IT之家
IT之家
V
V2EX
C
Check Point Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
B
Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网

姓王者的博客

Linux用户Secure Boot自主维护指南 | 姓王者的博客 MAD Bugs 已经开始——关于信息安全的军备竞赛 | 姓王者的博客 解决钉钉Dingtalk无法在Linux新版内核上启动问题-修复可执行栈错误 | 姓王者的博客 突发:GitHub 正遭受大规模 Issue 赌博广告轰炸 | 姓王者的博客 Ubuntu26.04-beta体验:坚毅浣熊! | 姓王者的博客 fakeclaw装作龙虾发贴吧 | 姓王者的博客 找回12年前的QQ记忆 | 姓王者的博客 在Linux上玩Flash网页游戏-洛克王国 | 姓王者的博客 Copilot将使用交互数据来训练 | 姓王者的博客 重要通知-请更新我的GPG公钥 | 姓王者的博客 为了自由Android | 姓王者的博客 GPL"2,3"事 | 姓王者的博客 短文-对VitePlus的一点🤏小贡献 | 姓王者的博客 Bing收录没了?亲测有效的快速恢复指南 | 姓王者的博客 解决桌面设备二维码快速识别的工具-ClipQR | 姓王者的博客 解决 Nautilus 自定义终端插件安装依赖问题 | 姓王者的博客 OpenClaw 该熄火了 | 姓王者的博客 Vite8 - 统一的基建开始 | 姓王者的博客 Astro 6 推出啦 | 姓王者的博客 ubuntu的openvpn异常暂停推送更新 | 姓王者的博客 Ubuntu 24.04 安装 Win10 虚拟机 | 姓王者的博客 ESA-后记:热爱阿里云 | 姓王者的博客 Moonbit 0.8.0 重大发布,我也要改一下我的包 | 姓王者的博客 ESA Pages 边缘开发大赛获奖 | 姓王者的博客 Astro: 优化katex,mermaid和灯箱使用 | 姓王者的博客 从edgeone迁移到esa | 姓王者的博客 出租人类:AI时代的荒诞与真实 | 姓王者的博客 Astro 5.17构建性能优化实践:从18s到13s | 姓王者的博客 Moonbit License Checker 开发使用 | 姓王者的博客 Stalux Astro博客主题自荐 | 姓王者的博客
制作github贪吃蛇贡献图 | 姓王者的博客
作者:xingwangzhe · 2024-11-11 · via 姓王者的博客

🕒 阅读时间:1 分钟 📝 字数:331 👀 阅读量: Loading...

蛇图

如图所示,非常有趣:)

xingwangzhe/xingwangzhe: My personal repository

你可以查看我的主页仓库来看具体效果:)

创建workflow

在你的主页目录下建立

.github/workflows/snake.yml

2024-11-11-092848

接下来你需要复制我仓库中的snake.yml中的代码,方便起见,我直接贴在下面

name: Generate snake animation

on:

schedule:

- cron: "0 0 * * *" # run daily at mignight UTC

workflow_dispatch:

push:

branches:

- main

jobs:

generate:

permissions:

contents: write

runs-on: ubuntu-latest

timeout-minutes: 10

steps:

- name: generate snake.svg

uses: Platane/snk@v3

with:

# github user name to read the contribution graph from (**required**)

# using action context var `github.repository_owner` or specified user

github_user_name: ${{ github.repository_owner }}

# list of files to generate.

# one file per line. Each output can be customized with options as query string.

#

# supported options:

# - palette: A preset of color, one of [github, github-dark, github-light]

# - color_snake: Color of the snake

# - color_dots: Coma separated list of dots color.

# The first one is 0 contribution, then it goes from the low contribution to the highest.

# Exactly 5 colors are expected.

outputs: |

dist/github-snake.svg

dist/github-snake-dark.svg?palette=github-dark

dist/ocean.gif?color_snake=orange&color_dots=#bfd6f6,#8dbdff,#64a1f4,#4b91f1,#3c7dd9

- name: Deploy to GitHub Pages

uses: crazy-max/ghaction-github-pages@v4

with:

target_branch: output

build_dir: dist

env:

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

然后点击上部导航栏的Actions查看snake.yml的状态,创建完毕后,会出现新的分支output。打开这个分支

2024-11-11-093349

你就会发现贪吃蛇的图了

引用使用

你需要把下面的路径中的xingwangzhe换成自己的github用户名

<!-- snake -->

<picture>

<source

media="(prefers-color-scheme: dark)"

srcset="https://github.com/xingwangzhe/xingwangzhe/blob/output/github-snake-dark.svg"

/>

<source

media="(prefers-color-scheme: light)"

srcset="https://github.com/xingwangzhe/xingwangzhe/blob/output/github-snake.svg"

/>

![github-snake](github-snake.svg)

</picture>

于是乎,大功告成!

参考

【教程】我在GitHub个人主页玩贪吃蛇_哔哩哔哩_bilibili