✨ feat(cdn): Add CDN URL configuration and update related references
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user