feat: get last url param
This commit is contained in:
parent
34e32abe51
commit
8dc528b39c
1 changed files with 5 additions and 1 deletions
|
@ -6,9 +6,13 @@ import Layout from "../layouts/Layout.astro";
|
||||||
import Library from "../components/Library.astro";
|
import Library from "../components/Library.astro";
|
||||||
import Footer from "../components/Footer.astro";
|
import Footer from "../components/Footer.astro";
|
||||||
|
|
||||||
const url = Astro.url.searchParams.get('url');
|
let url = Astro.url.searchParams.get('url');
|
||||||
let article: ArticleData | null = {url: '/'};
|
let article: ArticleData | null = {url: '/'};
|
||||||
|
|
||||||
|
while (url?.startsWith(Astro.url.origin)) {
|
||||||
|
url = new URL(url).searchParams.get('url');
|
||||||
|
}
|
||||||
|
|
||||||
if (url)
|
if (url)
|
||||||
try {
|
try {
|
||||||
article = await extract(url);
|
article = await extract(url);
|
||||||
|
|
Loading…
Reference in a new issue