added redirects to new docs
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
---
|
||||
const { frontmatter } = Astro.props;
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import { Icon } from "astro-icon/components";
|
||||
import DonationCallout from "../components/DonationCallout.astro";
|
||||
import "../styles/sidebar.scss";
|
||||
const title = frontmatter.title + " | Docs";
|
||||
const unsortedDocs = await Astro.glob("../pages/docs/*/*.{md,mdx}");
|
||||
const docs = unsortedDocs.sort((a) =>
|
||||
a.url === "/docs/" + a.frontmatter.repo ? -1 : 1
|
||||
);
|
||||
---
|
||||
|
||||
<Layout
|
||||
title={title}
|
||||
description="This is my personal website with my projects, docs and other useful stuff."
|
||||
>
|
||||
<div class="content">
|
||||
<h1 style="text-align: center;">{frontmatter.title}</h1>
|
||||
<br />
|
||||
<br />
|
||||
<slot />
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<div class="sidebar" style="display: unset;">
|
||||
<a
|
||||
class="repo-link"
|
||||
href={"https://github.com/vaporvee/" + frontmatter.repo}
|
||||
target="_blank"
|
||||
><span style="font-size: 14px;">vaporvee /</span>{frontmatter.repo}</a
|
||||
><br /><br />
|
||||
{
|
||||
docs.map((page) => {
|
||||
const isActive =
|
||||
Astro.url.pathname == page.url + "/" ||
|
||||
(Astro.url.pathname.startsWith(page.url) &&
|
||||
page.url !== "/docs/" + page.frontmatter.repo);
|
||||
return (
|
||||
<a href={page.url} class={isActive ? "active" : ""}>
|
||||
<Icon name="mdi:file-outline" />
|
||||
{page.frontmatter.title} <br />
|
||||
</a>
|
||||
);
|
||||
})
|
||||
}
|
||||
<DonationCallout
|
||||
text="These projects require a lot of time and effort. If you make money using this project, consider donating of whatever it's worth to you!"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
28
src/layouts/Redirect.astro
Normal file
28
src/layouts/Redirect.astro
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
interface Props {
|
||||
href: string;
|
||||
}
|
||||
|
||||
const { href } = Astro.props;
|
||||
import "../styles/main.scss";
|
||||
import "../styles/callout.scss";
|
||||
|
||||
import { ViewTransitions } from "astro:transitions";
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="darkreader-lock" />
|
||||
<meta name="theme-color" content="#1c1427" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta http-equiv="refresh" content={"0; url=" + href} />
|
||||
<title>Redirecting... | vaporvee's Website</title>
|
||||
<ViewTransitions />
|
||||
</head>
|
||||
<body>
|
||||
<a href={href}>Click if not redirecting</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user