mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-23 11:03:39 +00:00
Cleanup
This commit is contained in:
@@ -81,7 +81,6 @@ export function createImageResizer({
|
||||
|
||||
searchParams.set('sign', cachedSignature.signature);
|
||||
searchParams.set('sv', cachedSignature.version);
|
||||
searchParams.set('sid', imagesContextId);
|
||||
|
||||
return `${url}?${searchParams.toString()}`;
|
||||
};
|
||||
|
||||
@@ -72,9 +72,6 @@ const generateSignatureV2: SignFn = async (input) => {
|
||||
.join(':');
|
||||
|
||||
const signature = fnv1a(all, { utf8Buffer: fnv1aUtf8Buffer }).toString(16);
|
||||
|
||||
console.log(`generateSignatureV2: "${all}" -> "${signature}"`);
|
||||
|
||||
return signature;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import { filterOutNullable } from '@/lib/typescript';
|
||||
import { getCacheTag } from '@gitbook/cache-tags';
|
||||
import type { GitBookSiteContext } from '@v2/lib/context';
|
||||
import { getCloudflareContext } from '@v2/lib/data/cloudflare';
|
||||
import { GITBOOK_RUNTIME } from '@v2/lib/env';
|
||||
import { getResizedImageURL } from '@v2/lib/images';
|
||||
|
||||
const googleFontsMap: { [fontName in CustomizationDefaultFont]: string } = {
|
||||
@@ -116,18 +115,8 @@ export async function serveOGImage(baseContext: GitBookSiteContext, params: Page
|
||||
body: baseColors[useLightTheme ? 'dark' : 'light'], // Invert text on background
|
||||
};
|
||||
|
||||
// For Cloudflare, we use absolute URLs from the root of the site instead
|
||||
// to avoid issues with worker to worker requests in the same zone.
|
||||
const gridWhitePath = 'images/ogimage-grid-white.png';
|
||||
const gridDarkPath = 'images/ogimage-grid-black.png';
|
||||
const gridWhite =
|
||||
GITBOOK_RUNTIME === 'cloudflare'
|
||||
? linker.toAbsoluteURL(`/~gitbook/static/${gridWhitePath}`)
|
||||
: getAssetURL(gridWhitePath);
|
||||
const gridBlack =
|
||||
GITBOOK_RUNTIME === 'cloudflare'
|
||||
? linker.toAbsoluteURL(`/~gitbook/static/${gridDarkPath}`)
|
||||
: getAssetURL(gridDarkPath);
|
||||
const gridWhite = getAssetURL('images/ogimage-grid-white.png');
|
||||
const gridBlack = getAssetURL('images/ogimage-grid-black.png');
|
||||
|
||||
let gridAsset = useLightTheme ? gridBlack : gridWhite;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user