HelloGitHub-Team / geese

采用 Next.js 构建的开源爱好者社区。An open-source enthusiast community built with Next.js.
https://hellogithub.com
Apache License 2.0
282 stars 66 forks source link

动态生成 svg 文件的功能 #82

Closed 521xueweihan closed 1 year ago

521xueweihan commented 1 year ago

需求

实现类似的此网站徽章功能:https://www.producthunt.com/posts/mayfair/embed

截屏2022-12-29 15 00 37

背景

实现类似 ProductHunt 的 embed(嵌入)功能,可根据开源项目在 HelloGitHub 网站获得的点赞数,生成网站徽章。

该徽章可放在开源项目 GitHub 首页、官网、文档等位置,实现技术采用前端根据参数生成 svg 图像,优势在于:

  1. svg 体积小
  2. 矢量图像可在嵌入时控制图像尺寸

思路

  1. 根据传入的项目 id,绘制 svg 图像(是否需要引入库?)
  2. 可否根据 svg 模版,挖出坑动态转入值
cqh963852 commented 1 year ago

所以是需要一个 tool ,定时生成这个 svg 吗?

521xueweihan commented 1 year ago

@cqh963852 需要一个页面,可根据请求的参数,实时生成对应的点赞数的 svg

gaelthas commented 1 year ago

https://github.com/badges/shields 用这个可以吗

521xueweihan commented 1 year ago

@gaelthas 感谢,我已经通过后端实现了大部分功能,在调细节~

gaelthas commented 1 year ago

@gaelthas 感谢,我已经通过后端实现了大部分功能,在调细节~

666

github-actions[bot] commented 1 year ago

Branch i82-动态生成_svg_文件的功能 created!

521xueweihan commented 1 year ago

已完成

截屏2023-01-06 14 49 48