From 863df46ff913e4d770117cd4e376b76b96119076 Mon Sep 17 00:00:00 2001 From: Pablo Hdez <62877300+pheralb@users.noreply.github.com> Date: Tue, 24 Sep 2024 07:49:55 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Activate=20``prerender``?= =?UTF-8?q?=20to=20``/directory``=20routes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/directory/[slug]/+page.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/directory/[slug]/+page.ts b/src/routes/directory/[slug]/+page.ts index 8724bcc..eb91b6b 100644 --- a/src/routes/directory/[slug]/+page.ts +++ b/src/routes/directory/[slug]/+page.ts @@ -4,6 +4,8 @@ import type { PageLoad } from './$types'; import { svgs } from '@/data/svgs'; import type { iSVG } from '@/types/svg'; +export const prerender = true; + export const load = (async ({ params }) => { const { slug } = params; @@ -15,7 +17,7 @@ export const load = (async ({ params }) => { // Filter out the svg with the matching slug: const svgsByCategory = svgs.filter((svg: iSVG) => { if (Array.isArray(svg.category)) { - return svg.category.some(categoryItem => categoryItem.toLowerCase() === slug); + return svg.category.some((categoryItem) => categoryItem.toLowerCase() === slug); } else { return svg.category.toLowerCase() === slug; }