mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: some static params
This commit is contained in:
1 parent
8f44cdedd4
commit
d306b51c2c
10 files changed
+61
-8
No files matched your search
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"dev:website": "bun --filter=@blitzkit/website run dev",
|
"dev:website": "bun --filter=@blitzkit/website run dev",
|
||||||
"dev:api": "bun --filter=@blitzkit/api run dev",
|
"dev:api": "bun --filter=@blitzkit/api run dev",
|
||||||
"start:bot": "bun dist/bot/index.js",
|
"start:bot": "bun dist/bot/index.js",
|
||||||
"start:website": "next start",
|
"start:website": "bun --filter=@blitzkit/website run start",
|
||||||
"host:docs": "vitepress preview docs",
|
"host:docs": "vitepress preview docs",
|
||||||
"lint": "tsc",
|
"lint": "tsc",
|
||||||
"lint:website": "next lint",
|
"lint:website": "next lint",
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build"
|
"build": "next build",
|
||||||
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/themes": "^3.1.3",
|
"@radix-ui/themes": "^3.1.3",
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export const PROVIDERS = ['wargaming', 'patreon'];
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
import { PROVIDERS } from './page';
|
import { PROVIDERS } from './constants';
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
return PROVIDERS.map((provider) => ({ provider }));
|
return PROVIDERS.map((provider) => ({ provider }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
@@ -6,8 +6,6 @@ import { useEffect } from 'react';
|
|||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
import * as App from '../../../stores/app';
|
import * as App from '../../../stores/app';
|
||||||
|
|
||||||
export const PROVIDERS = ['wargaming', 'patreon'];
|
|
||||||
|
|
||||||
export interface PatreonAuthResponse {
|
export interface PatreonAuthResponse {
|
||||||
access_token: string;
|
access_token: string;
|
||||||
expires_in: number;
|
expires_in: number;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import { assertSecret } from '@blitzkit/core';
|
||||||
|
|
||||||
|
export async function generateStaticParams() {
|
||||||
|
return await fetch(
|
||||||
|
`https://api.github.com/repos/tresabhi/blitzkit/contents/docs?ref=${assertSecret(
|
||||||
|
process.env.NEXT_PUBLIC_ASSET_BRANCH,
|
||||||
|
)}`,
|
||||||
|
)
|
||||||
|
.then((response) => response.json() as Promise<{ name: string }[]>)
|
||||||
|
.then((directories) =>
|
||||||
|
Promise.all(
|
||||||
|
directories
|
||||||
|
.filter(
|
||||||
|
(directory) =>
|
||||||
|
!['.vitepress', 'public', 'index.md'].includes(directory.name),
|
||||||
|
)
|
||||||
|
.map((directory) =>
|
||||||
|
fetch(
|
||||||
|
`https://api.github.com/repos/tresabhi/blitzkit/contents/docs/${directory.name}?ref=${assertSecret(
|
||||||
|
process.env.NEXT_PUBLIC_ASSET_BRANCH,
|
||||||
|
)}`,
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
(response) => response.json() as Promise<{ name: string }[]>,
|
||||||
|
)
|
||||||
|
.then((docs) =>
|
||||||
|
docs
|
||||||
|
.map((document) => {
|
||||||
|
console.log(`${directory.name}/${document.name}`);
|
||||||
|
return document;
|
||||||
|
})
|
||||||
|
.map((document) => ({
|
||||||
|
document: document.name.split('.').slice(0, -1).join('.'),
|
||||||
|
directory: directory.name,
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.then((docs) => docs.flat());
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
@@ -3,6 +3,10 @@ import * as EmbedState from '../../../../stores/embedState';
|
|||||||
import { configurations } from '../configurations';
|
import { configurations } from '../configurations';
|
||||||
import { extractEmbedConfigDefaults } from '../utilities';
|
import { extractEmbedConfigDefaults } from '../utilities';
|
||||||
|
|
||||||
|
export function generateStaticParams() {
|
||||||
|
return Object.keys(configurations).map((embed) => ({ embed }));
|
||||||
|
}
|
||||||
|
|
||||||
export default function Layout({
|
export default function Layout({
|
||||||
params,
|
params,
|
||||||
children,
|
children,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { PageWrapper } from '../../../components/PageWrapper';
|
import { PageWrapper } from '../../../components/PageWrapper';
|
||||||
|
|
||||||
export function Page() {
|
export default function Page() {
|
||||||
return <PageWrapper></PageWrapper>;
|
return <PageWrapper></PageWrapper>;
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,6 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
".next/types/**/*.ts",
|
".next/types/**/*.ts",
|
||||||
"dist/website/types/**/*.ts"
|
"../../dist/website/types/**/*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+1
-1
@@ -20,5 +20,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules/**/*", "dist"]
|
"exclude": ["node_modules/**/*", "dist", ".next"]
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user