feat(cdn): Add CDN URL configuration and update related references

This commit is contained in:
web@ppanel
2025-03-08 12:54:58 +07:00
parent e4630f8ca9
commit 0c907337e1
3 changed files with 7 additions and 3 deletions
+4 -3
View File
@@ -1,14 +1,15 @@
import { NEXT_PUBLIC_CDN_URL } from '@/config/constants';
import matter from 'gray-matter';
const BASE_URL = 'https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-tutorial';
const BASE_URL = `${NEXT_PUBLIC_CDN_URL}/gh/perfect-panel/ppanel-tutorial`;
async function getVersion() {
// API rate limit: 60 requests per hour
const response = await fetch(
'https://api.github.com/repos/perfect-panel/ppanel-tutorial/commits',
'https://data.jsdelivr.com/v1/stats/packages/gh/perfect-panel/ppanel-tutorial/versions',
);
const json = await response.json();
return json[0].sha;
return json[0].version;
}
async function getVersionPath() {