Skip to content

Commit

Permalink
docs: fix blurry avatars (#2475)
Browse files Browse the repository at this point in the history
* docs(fix): blurry avatars

* chore: keep main lock file
  • Loading branch information
userquin committed Dec 9, 2022
1 parent 0a78859 commit b51cda3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions docs/.vitepress/scripts/fetch-avatars.ts
@@ -1,15 +1,13 @@
import { join, resolve } from 'pathe'
import fs from 'fs-extra'
import { $fetch } from 'ohmyfetch'
import { teamMembers } from '../contributors'

const docsDir = resolve(__dirname, '../..')
const pathContributors = resolve(docsDir, '.vitepress/contributor-names.json')
const dirAvatars = resolve(docsDir, 'public/user-avatars/')
const dirSponsors = resolve(docsDir, 'public/sponsors/')

let contributors: string[] = []
const team = teamMembers.map(i => i.github)

async function download(url: string, fileName: string) {
if (fs.existsSync(fileName))
Expand All @@ -27,7 +25,7 @@ async function fetchAvatars() {
await fs.ensureDir(dirAvatars)
contributors = JSON.parse(await fs.readFile(pathContributors, { encoding: 'utf-8' }))

await Promise.all(contributors.map(name => download(`https://github.com/${name}.png?size=${team.includes(name) ? 100 : 40}`, join(dirAvatars, `${name}.png`))))
await Promise.all(contributors.map(name => download(`https://github.com/${name}.png?size=100`, join(dirAvatars, `${name}.png`))))
}

async function fetchSponsors() {
Expand Down
1 change: 1 addition & 0 deletions docs/package.json
Expand Up @@ -7,6 +7,7 @@
"build-no-prefetch": "vitepress build && node .vitepress/scripts/build-pwa.mjs",
"serve": "vitepress serve",
"preview-https": "pnpm run build && serve .vitepress/dist",
"preview-https-no-prefetch": "pnpm run build-no-prefetch && serve .vitepress/dist",
"prefetch": "esno .vitepress/scripts/fetch-avatars.ts"
},
"dependencies": {
Expand Down

0 comments on commit b51cda3

Please sign in to comment.