|
|
|
@ -6,7 +6,6 @@ import satori from 'satori'; |
|
|
|
|
import sharp from 'sharp'; |
|
|
|
|
import imageSize from 'image-size'; |
|
|
|
|
import { Resvg } from '@resvg/resvg-js'; |
|
|
|
|
import { getRepositoryRank } from '../src/lib/github'; |
|
|
|
|
|
|
|
|
|
const ALL_ROADMAP_DIR = path.join(process.cwd(), '/src/data/roadmaps'); |
|
|
|
|
const ALL_BEST_PRACTICE_DIR = path.join( |
|
|
|
@ -29,11 +28,6 @@ const alreadyGeneratedImages = await fs.readdir( |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
async function updateRank() { |
|
|
|
|
const repoRank = await getRepositoryRank('kamranahmedse/developer-roadmap'); |
|
|
|
|
document.getElementById('repo-rank').innerText = `${repoRank} most starred GitHub project`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function getAllRoadmaps() { |
|
|
|
|
const allRoadmapDirNames = await fs.readdir(ALL_ROADMAP_DIR); |
|
|
|
|
|
|
|
|
@ -148,8 +142,6 @@ async function getAllBestPracticeImageIds() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function generateResourceOpenGraph() { |
|
|
|
|
await updateRank(); |
|
|
|
|
|
|
|
|
|
const allRoadmaps = (await getAllRoadmaps()).filter( |
|
|
|
|
(roadmap) => !alreadyGeneratedImages.includes(`roadmaps/${roadmap.id}.png`), |
|
|
|
|
); |
|
|
|
@ -379,8 +371,8 @@ function getRoadmapDefaultTemplate({ title, description }) { |
|
|
|
|
/> |
|
|
|
|
</svg> |
|
|
|
|
</div> |
|
|
|
|
<div tw="text-[30px] flex leading-[30px]" id="repo-rank"> |
|
|
|
|
Loading... |
|
|
|
|
<div tw="text-[30px] flex leading-[30px]"> |
|
|
|
|
7th most starred GitHub project |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div tw="flex items-center mt-2.5"> |
|
|
|
|