
* chore: add favicon * fix: home article url * fix: prevent duplicated history entry (unencoded & encoded) * fix: prevent own app * remove console.log * fix: prevent showing cached cozy
28 lines
817 B
Text
28 lines
817 B
Text
---
|
|
import { ArticleData, extract } from "@extractus/article-extractor";
|
|
import AddressBar from "../components/AddressBar.astro";
|
|
import Post from "../components/Post.astro";
|
|
import Layout from "../layouts/Layout.astro";
|
|
import Library from "../components/Library.astro";
|
|
import Footer from "../components/Footer.astro";
|
|
|
|
const url = Astro.url.searchParams.get('url');
|
|
let article: ArticleData | null = {url: '/'};
|
|
|
|
if (url)
|
|
try {
|
|
article = await extract(url);
|
|
} catch {
|
|
article = null;
|
|
}
|
|
|
|
const routerOutletID = "router-outlet";
|
|
---
|
|
<Layout article={article}>
|
|
<AddressBar url={url} />
|
|
<div slot="post" id={routerOutletID}>
|
|
<Post article={article} />
|
|
</div>
|
|
<Library slot="library" skipSave={article === null} routerOutlet={routerOutletID}/>
|
|
<Footer slot="footer" />
|
|
</Layout>
|