@@ -4,19 +4,21 @@ import { ImageResponse } from 'next/og';
44
55import { DEFAULT_CATEGORY_OG_TYPE } from '#site/next.constants.mjs' ;
66import { defaultLocale } from '#site/next.locales.mjs' ;
7- import { hexToRGBA } from '#site/util/hexToRGBA' ;
87
98// TODO: use CSS variables instead of absolute values
109const CATEGORY_TO_THEME_COLOUR_MAP = {
11- announcement : '#1a3f1d ' ,
12- release : '#0c7bb3 ' ,
13- vulnerability : '#ae5f00 ' ,
10+ announcement : 'rgb(26, 63, 29) ' ,
11+ release : 'rgb(12, 123, 179) ' ,
12+ vulnerability : 'rgb(174, 95, 0) ' ,
1413} ;
1514
16- type Category = keyof typeof CATEGORY_TO_THEME_COLOUR_MAP ;
17-
18- type DynamicStaticPaths = { locale : string ; category : Category ; title : string } ;
19- type StaticParams = { params : Promise < DynamicStaticPaths > } ;
15+ type StaticParams = {
16+ params : Promise < {
17+ locale : string ;
18+ category : keyof typeof CATEGORY_TO_THEME_COLOUR_MAP ;
19+ title : string ;
20+ } > ;
21+ } ;
2022
2123// This is the Route Handler for the `GET` method which handles the request
2224// for generating OpenGraph images for Blog Posts and Pages
@@ -29,7 +31,7 @@ export const GET = async (_: Request, props: StaticParams) => {
2931 ? CATEGORY_TO_THEME_COLOUR_MAP [ params . category ]
3032 : CATEGORY_TO_THEME_COLOUR_MAP [ DEFAULT_CATEGORY_OG_TYPE ] ;
3133
32- const gridBackground = `radial-gradient(circle, ${ hexToRGBA ( categoryColour ) } , transparent)` ;
34+ const gridBackground = `radial-gradient(circle, ${ categoryColour } , transparent)` ;
3335
3436 return new ImageResponse (
3537 (
0 commit comments