refactor(website): switch to dynamic only

This commit is contained in:
iCrawl
2025-05-30 02:29:15 +02:00
parent 2c35084ecd
commit 762bbc6525
37 changed files with 4315 additions and 3630 deletions

View File

@@ -28,33 +28,16 @@ export const metadata: Metadata = {
icons: {
other: [
{
url: '/favicon-32x32.png',
sizes: '32x32',
type: 'image/png',
},
{
url: '/favicon-16x16.png',
sizes: '16x16',
url: '/favicon-96x96.png',
sizes: '96x96',
type: 'image/png',
},
],
apple: [
'/apple-touch-icon.png',
{
url: '/safari-pinned-tab.svg',
rel: 'mask-icon',
},
],
apple: ['/apple-touch-icon.png'],
},
manifest: '/site.webmanifest',
appleWebApp: {
title: 'discord.js',
},
applicationName: 'discord.js',
openGraph: {
siteName: 'discord.js',
type: 'website',
@@ -67,10 +50,6 @@ export const metadata: Metadata = {
card: 'summary_large_image',
creator: '@iCrawlToGo',
},
other: {
'msapplication-TileColor': '#1a1a1e',
},
};
export default async function RootLayout({ children }: PropsWithChildren) {

View File

@@ -12,9 +12,9 @@ export const size = {
export const contentType = 'image/png';
export default async function Image() {
const fontData = await fetch(new URL('../assets/Geist-Black.ttf', import.meta.url), {
next: { revalidate: 604_800 },
}).then(async (res) => res.arrayBuffer());
const fontData = await fetch(new URL('../assets/Geist-Black.ttf', import.meta.url), { cache: 'force-cache' }).then(
async (res) => res.arrayBuffer(),
);
return new ImageResponse(
(

View File

@@ -27,10 +27,9 @@ export async function fetchDependencies({
}
try {
const isMain = version === 'main';
const fileContent = await fetch(
`${process.env.CF_R2_DOCS_BUCKET_URL}/${packageName}/${version}.dependencies.api.json`,
{ next: { revalidate: isMain ? 0 : 604_800 } },
{ cache: 'no-store' },
);
const parsedDependencies = await fileContent.json();

View File

@@ -26,10 +26,9 @@ export async function fetchEntryPoints(packageName: string, version: string) {
}
}
const isMain = version === 'main';
const fileContent = await fetch(
`${process.env.CF_R2_DOCS_BUCKET_URL}/${packageName}/${version}.entrypoints.api.json`,
{ next: { revalidate: isMain ? 0 : 604_800 } },
{ cache: 'no-store' },
);
if (!fileContent.ok) {

View File

@@ -34,10 +34,9 @@ export async function fetchNode({
}
}
const isMain = version === 'main';
const fileContent = await fetch(
`${process.env.CF_R2_DOCS_BUCKET_URL}/${packageName}/${version}.${normalizedEntryPoint}${normalizeItem}.api.json`,
{ next: { revalidate: isMain ? 0 : 604_800 } },
{ cache: 'no-store' },
);
if (!fileContent.ok) {

View File

@@ -31,12 +31,9 @@ export async function fetchSitemap({
}
}
const isMain = version === 'main';
const fileContent = await fetch(
`${process.env.CF_R2_DOCS_BUCKET_URL}/${packageName}/${version}.${normalizedEntryPoint}sitemap.api.json`,
{
next: { revalidate: isMain ? 0 : 604_800 },
},
{ cache: 'no-store' },
);
if (!fileContent.ok) {