fix: Resolve IDE type errors for local development
This commit is contained in:
@@ -139,9 +139,10 @@ export function generateFeaturedImage(input: ImageGeneratorInput): GeneratedImag
|
|||||||
.replace(/{subtitle}/g, escapeXml(input.subtitle || template.subtitle_text || ''));
|
.replace(/{subtitle}/g, escapeXml(input.subtitle || template.subtitle_text || ''));
|
||||||
|
|
||||||
// Generate base64 data URI for inline use
|
// Generate base64 data URI for inline use
|
||||||
const base64 = typeof Buffer !== 'undefined'
|
// Use TextEncoder for Node 18+ and browser compatibility
|
||||||
? Buffer.from(svg).toString('base64')
|
const encoder = new TextEncoder();
|
||||||
: btoa(unescape(encodeURIComponent(svg)));
|
const bytes = encoder.encode(svg);
|
||||||
|
const base64 = btoa(String.fromCharCode(...bytes));
|
||||||
const dataUri = `data:image/svg+xml;base64,${base64}`;
|
const dataUri = `data:image/svg+xml;base64,${base64}`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// @ts-ignore - Astro types available at build time
|
||||||
import type { APIRoute } from 'astro';
|
import type { APIRoute } from 'astro';
|
||||||
import { getDirectusClient, readItems, createItem, updateItem } from '@/lib/directus/client';
|
import { getDirectusClient, readItems, createItem, updateItem } from '@/lib/directus/client';
|
||||||
import { parseSpintaxRandom, injectVariables } from '@/lib/seo/cartesian';
|
import { parseSpintaxRandom, injectVariables } from '@/lib/seo/cartesian';
|
||||||
|
|||||||
Reference in New Issue
Block a user