From 9c1627b3e5928da5eb39897350acd733dc6d3e97 Mon Sep 17 00:00:00 2001 From: Ayo Date: Sun, 1 Oct 2023 08:48:33 +0200 Subject: [PATCH] feat: cozify to prefetch links and open in cozy --- src/components/Post.astro | 4 ++-- src/utils/sanitizer.ts | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/Post.astro b/src/components/Post.astro index c120eea..e4a80ba 100644 --- a/src/components/Post.astro +++ b/src/components/Post.astro @@ -1,6 +1,6 @@ --- import { ArticleData } from "@extractus/article-extractor"; -import clean from '../utils/sanitizer'; +import { cozify } from "../utils/sanitizer" export interface Props { article: ArticleData | null; } @@ -14,7 +14,7 @@ article ??= error; const datePublished = article?.published && new Date(article.published).toDateString(); -const cleanContent = clean(article.content ?? '') +const cleanContent = await cozify(article.content ?? '', Astro.url.origin) ---