refactor: make the catch-all content HTML

This commit is contained in:
Ayo 2023-05-13 14:51:36 +02:00
parent 80190edb7b
commit 7283b22a13

View file

@ -6,14 +6,14 @@ import Post from "../components/post.astro";
import Layout from "../layouts/layout.astro"; import Layout from "../layouts/layout.astro";
const params = getParams(Astro.url); const params = getParams(Astro.url);
const url: string = params?.url || ""; const url = params?.url;
let article; let article;
try { try {
article = isURL(url) && (await extract(url)); article = isURL(url) && (await extract(url));
} catch { } catch {
article = { article = {
title: "Something is not right", title: "Something is not right",
content: "The article extractor did not get any result", content: "<p>The article extractor did not get any result</p>",
}; };
} }
--- ---