feat: use better names for md files

This commit is contained in:
Max Richter
2025-11-04 13:26:49 +01:00
parent 3103ed19fb
commit 56a104c8b9
6 changed files with 37 additions and 21 deletions

View File

@@ -5,7 +5,7 @@ import * as openai from "@lib/openai.ts";
import { createLogger } from "@lib/log/index.ts";
import recipeSchema from "@lib/recipeSchema.ts";
import { fileExtension } from "https://deno.land/x/file_extension@v2.1.0/mod.ts";
import { safeFileName } from "@lib/string.ts";
import { safeFileName, toUrlSafeString } from "@lib/string.ts";
import { parseJsonLdToRecipeSchema } from "./parseJsonLd.ts";
import z from "zod";
import { createResource } from "@lib/marka/index.ts";
@@ -58,7 +58,7 @@ async function processCreateRecipeFromUrl(
recipe = res;
}
const id = safeFileName(recipe?.name || "");
const id = toUrlSafeString(recipe?.name || "");
if (!recipe) {
streamResponse.enqueue("failed to parse recipe");