Add link type, remove heroImage

This commit is contained in:
2024-03-10 08:50:12 -05:00
parent 94222bfb8e
commit a7a4a4765e
5 changed files with 7 additions and 12 deletions

View File

@@ -17,8 +17,8 @@ import { version } from "@/../package.json";
<footer class="dark:text-zinc-400 pt-8 px-4 pb-24 text-center">
<p>
<a href={GITHUB_URL} target="_blank">Handbook</a> v{version}
<a href={`${GITHUB_URL}/commit/${longHash}`} target="_blank"
>({shortHash})</a
>
<a href={`${GITHUB_URL}/commit/${longHash}`} target="_blank">
({shortHash})
</a>
</p>
</footer>

View File

@@ -1,5 +1,5 @@
---
import get from '@/content/sidebar';
import get, {Link} from '@/content/sidebar';
import clsx from 'clsx';
const { currentPage } = Astro.props;
const currentPageMatch = currentPage.slice(1);
@@ -11,7 +11,7 @@ const isCurrentPage = (item): boolean => {
return false;
};
const getLinkClasses = (link) => {
const getLinkClasses = (link: Link) => {
const baseClasses = "block py-2 px-6 my-1 transition-colors border-l hover:border-zinc-400 hover:text-slate-900"
const isCurrent = isCurrentPage(link);

View File

@@ -3,12 +3,11 @@ import type { CollectionEntry } from 'astro:content';
import BaseHead from '@components/BaseHead.astro';
import Header from '@components/Header.astro';
import Footer from '@components/Footer.astro';
import FormattedDate from '@components/FormattedDate.astro';
import Sidebar from '@components/Sidebar.astro';
type Props = CollectionEntry<'handbook'>['data'];
const { title, description, pubDate, heroImage, lastModified } = Astro.props;
const { title, description, pubDate, lastModified } = Astro.props;
const currentPage = new URL(Astro.request.url).pathname;
---
<html lang="en">
@@ -37,8 +36,8 @@ const currentPage = new URL(Astro.request.url).pathname;
</div>
<main class="py-4 px-8 pb-32 col-span-6 overflow-auto">
<div>
<!-- <PageContent content={content}>
<slot />
<!-- <PageContent content={content}>
</PageContent> -->
</div>
</main>

View File

@@ -1,7 +1,6 @@
---
import BaseHead from '@components/BaseHead.astro';
import Header from '@components/Header.astro';
import Footer from '@components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '@/consts';
import { getCollection } from 'astro:content';
import FormattedDate from '@components/FormattedDate.astro';
@@ -106,6 +105,5 @@ const posts = (await getCollection('handbook')).sort(
</ul>
</section>
</main>
<Footer />
</body>
</html>

View File

@@ -1,7 +1,6 @@
---
import BaseHead from '@components/BaseHead.astro';
import Header from '@components/Header.astro';
import Footer from '@components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
---
@@ -12,6 +11,5 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
</head>
<body class="dark:text-zinc-200 dark:bg-zinc-800">
<Header />
<Footer />
</body>
</html>