Skip to content

Commit

Permalink
调整生成贡献者svg
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git committed Oct 29, 2024
1 parent 5661701 commit ec8a01a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const svgPath = "../../static/contributors.svg"
const quality = 10

// 单个头像的宽高
const width = 30, height = 30
const width = 65, height = 65
// 头像之间的间距
const xSpace = 2, ySpace = 2
// 每一行的头像数量
Expand Down Expand Up @@ -135,7 +135,7 @@ async function convertImageToBase64(url) {
const compressedBuffer = await sharp(Buffer.from(buffer))
.toFormat("jpeg", { quality })
.toBuffer()

const base64Image = compressedBuffer.toString("base64")

return `data:image/jpeg;base64,${base64Image}`
}
19 changes: 19 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,31 @@ function Users() {
);
}

function Contributors() {
return (
<section>
<div className="container mt-20">
<h1 className="text-center largest font-bold">
贡献者列表
</h1>
<div className="text-center mb-10">
感谢所有参与<code>GoFrame</code>开发的贡献者!!!
</div>
<div className="contributors text-center">
<img alt="GoFrame Contributors" src="/gf-site/contributors.svg" />
</div>
</div>
</section>
);
}

export default function Home(): JSX.Element {
return (
<Layout>
<HomepageHeader/>
<Features/>
<Users/>
<Contributors/>
<div className="mt-20"></div>
</Layout>
);
Expand Down

0 comments on commit ec8a01a

Please sign in to comment.