From 4a3030948f03636fb33f8ca7f6f828b3b71b334d Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Thu, 28 Dec 2023 11:39:27 +0500 Subject: [PATCH] Fix stats --- src/lib/roadmap.ts | 2 +- src/lib/video.ts | 2 +- src/pages/v1-stats.json.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/roadmap.ts b/src/lib/roadmap.ts index f6724fa4f..ce4b0ba12 100644 --- a/src/lib/roadmap.ts +++ b/src/lib/roadmap.ts @@ -133,7 +133,7 @@ export async function getRoadmapsByIds( export async function getRoadmapFaqsById(roadmapId: string): Promise { const { faqs } = await import( - `/src/data/roadmaps/${roadmapId}/faqs.astro` + `../data/roadmaps/${roadmapId}/faqs.astro` ).catch(() => ({})); return faqs || []; diff --git a/src/lib/video.ts b/src/lib/video.ts index 5bbb05e18..78c7b8671 100644 --- a/src/lib/video.ts +++ b/src/lib/video.ts @@ -64,7 +64,7 @@ export async function getAllVideos(): Promise { } export async function getVideoById(id: string): Promise { - const video = await import(`/src/data/videos/${id}.md`); + const video = await import(`../data/videos/${id}.md`); return { ...video, diff --git a/src/pages/v1-stats.json.ts b/src/pages/v1-stats.json.ts index 681fe6036..4986d75a4 100644 --- a/src/pages/v1-stats.json.ts +++ b/src/pages/v1-stats.json.ts @@ -1,5 +1,7 @@ import { execSync } from 'child_process'; +export const prerender = true; + export async function GET() { const commitHash = execSync('git rev-parse HEAD').toString().trim(); const commitDate = execSync('git log -1 --format=%cd').toString().trim();