打造个人跑步主页

发布于 2025-10-16  136814 次阅读


之前看到一个跑步相关的开源项目,链接是:https://github.com/yihong0618/running_page,依据这个项目我生成了一个自己的跑步主页,如果从记录的角度来说,一年一两条数据也算跑龄的话,显示我已经跑步了10年。

我的全部跑步记录都在悦跑圈这个APP,第一次跑步还是借高中同学的手机记录的,那个时候百度了一下记录跑步的APP选哪个好一些,然后选择了悦跑圈,然后跟着班长出校外去跑步,第一次跑刚开始可以跟一下班长,后面跟不上,理解了望其项背这个成语,就是能看到前面的背影,实际上如果对方不停下,或者自己不加速是追不上的,后面的故事很长有机会写个跑步故事系列。

依据项目从悦跑圈里面导出数据成sqllite格式的数据库数据,根据数据生成年度打卡 svg,轨迹汇总svg,年度热力图,显示的详细数据是导入的时候把数据导成一个 JSON 格式的数据做进一步汇总展示。

完成基础的安装后,根据命令去生成年度打卡,10km以下用默认颜色,10km 意思用黄色,20km以上用红色

python run_page/gen_svg.py --from-db --title "timewood running page" --type github --athlete "timewood" --special-distance 10 --special-distance2 20 --special-color yellow --special-color2 red --output assets/github.svg --use-localtime --min-distance 0.5

然后用命令生成轨迹汇总图,提取 10km 20 km 40km 以上的轨迹到轨迹汇总图

python run_page/gen_svg.py --from-db --title "timewood running page" --type grid --athlete "timewood" --output assets/grid.svg --min-distance 10.0 --special-color yellow --special-color2 red --special-distance 20 --special-distance2 40 --use-localtime

再然后生成年度热力图

python run_page/gen_svg.py --from-db --type circular --use-localtime

生成如果一生只有 1000 个月的 Runner Month of Life

python run_page/gen_svg.py --from-db --type monthoflife --birth 2000-03 --special-distance 10 --special-distance2 20 --special-color '#f9d367' --special-color2 '#f0a1a8' --output assets/mol.svg --use-localtime --athlete Timewood --title 'Runner Month of Life'

打包,可以部署到 Github 也可以部署 vercel 上面,看了一下国内网络不好访问,可以用 cf 加速挂载访问,我是直接用博客服务器的 nginx 解析一个子域名部署,地址:https://running.timewood.cn


纵有疾风起人生不言弃