mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(website): switch to dynamic only
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
(
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user