From 5c899b4a5c2c07398151960b2b86d238b49d5bf4 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 26 Jul 2026 11:57:13 +0200 Subject: Better Strapi integration --- corvos.config.ts | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'corvos.config.ts') diff --git a/corvos.config.ts b/corvos.config.ts index fd9826c..0cb3900 100644 --- a/corvos.config.ts +++ b/corvos.config.ts @@ -22,11 +22,12 @@ import { timestamps } from "corvos/plugins/timestamps.ts"; import { transformImages } from "corvos/plugins/transform_images.ts"; import { urls } from "corvos/plugins/urls.ts"; -import type { Node } from "$/deps/strapi.tsx"; +import type { Node } from "$/deps/strapi.ts"; import type { PageData } from "$/schemas/mod.ts"; -import { strapi } from "$/deps/strapi.tsx"; +import { strapi } from "$/deps/strapi.ts"; import { pageDataSchema } from "$/schemas/mod.ts"; +import { releaseStrapiSchema } from "$/schemas/releases.ts"; const assetPipeline = Pipeline.create() .use(cache()) @@ -53,7 +54,23 @@ const pagePipeline = Pipeline.create() .use(modules | Page<".", Uint8Array>>()) .use(markdown({ frontmatterSchema: pageDataSchema })) .use(mdx({ frontmatterSchema: pageDataSchema })) - .use(strapi()) + .use( + strapi({ + url: Deno.env.get("STRAPI_URL") ?? "", + token: Deno.env.get("STRAPI_TOKEN") ?? "", + content: { + "corvos-releases": { + type: "collection", + schema: releaseStrapiSchema, + query: { + "populate[0]": "files", + "sort[0]": "date:desc", + "sort[1]": "version:desc", + }, + }, + }, + }), + ) .use(jsx()) .use(urls({ base: new URL("https://corvos.volpeon.ink/") })) -- cgit v1.3.1