refactor: make the catch-all content HTML
This commit is contained in:
parent
80190edb7b
commit
7283b22a13
1 changed files with 2 additions and 2 deletions
|
@ -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>",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
---
|
---
|
||||||
|
|
Loading…
Reference in a new issue