build site with bun (#32)
This commit is contained in:
parent
3a886c4493
commit
bf087a566f
12 changed files with 100 additions and 9447 deletions
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import { SITE } from "@consts";
|
||||
import gradient from "../../public/assets/gradient.avif";
|
||||
import { ClientRouter } from 'astro:transitions';
|
||||
import { ClientRouter } from "astro:transitions";
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
|
|
|
@ -1,45 +1,49 @@
|
|||
import { defineCollection, z } from "astro:content";
|
||||
import { rssSchema } from '@astrojs/rss';
|
||||
import { rssSchema } from "@astrojs/rss";
|
||||
|
||||
const posts = defineCollection({
|
||||
type: "content",
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
date: z.coerce.date(),
|
||||
updated: z.date().optional(),
|
||||
draft: z.boolean().optional(),
|
||||
image: z.object({
|
||||
url: image(),
|
||||
alt: z.string(),
|
||||
}),
|
||||
tags: z.array(z.string()),
|
||||
extraAuthors: z.array(z.string()).optional(),
|
||||
categories: z.array(z.string()),
|
||||
}).merge(rssSchema)
|
||||
z
|
||||
.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
date: z.coerce.date(),
|
||||
updated: z.date().optional(),
|
||||
draft: z.boolean().optional(),
|
||||
image: z.object({
|
||||
url: image(),
|
||||
alt: z.string(),
|
||||
}),
|
||||
tags: z.array(z.string()),
|
||||
extraAuthors: z.array(z.string()).optional(),
|
||||
categories: z.array(z.string()),
|
||||
})
|
||||
.merge(rssSchema),
|
||||
});
|
||||
|
||||
const projects = defineCollection({
|
||||
type: "content",
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
date: z.coerce.date(),
|
||||
updated: z.date().optional(),
|
||||
draft: z.boolean().optional(),
|
||||
image: z.object({
|
||||
url: image(),
|
||||
alt: z.string(),
|
||||
}),
|
||||
tags: z.array(z.string()),
|
||||
extraAuthors: z.array(z.string()).optional(),
|
||||
categories: z.array(z.string()),
|
||||
featured: z.boolean().optional(),
|
||||
collection: z.boolean().optional(),
|
||||
includeHero: z.boolean().optional(),
|
||||
}).merge(rssSchema)
|
||||
z
|
||||
.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
date: z.coerce.date(),
|
||||
updated: z.date().optional(),
|
||||
draft: z.boolean().optional(),
|
||||
image: z.object({
|
||||
url: image(),
|
||||
alt: z.string(),
|
||||
}),
|
||||
tags: z.array(z.string()),
|
||||
extraAuthors: z.array(z.string()).optional(),
|
||||
categories: z.array(z.string()),
|
||||
featured: z.boolean().optional(),
|
||||
collection: z.boolean().optional(),
|
||||
includeHero: z.boolean().optional(),
|
||||
})
|
||||
.merge(rssSchema),
|
||||
});
|
||||
|
||||
const work = defineCollection({
|
||||
|
|
|
@ -24,9 +24,9 @@ On NixOS you can install Packard by including it as an input in flake.nix, then
|
|||
inputs = {
|
||||
packard.url = "github:troylusty/packard";
|
||||
};
|
||||
```
|
||||
|
||||
```nix
|
||||
...
|
||||
|
||||
environment.systemPackages = {
|
||||
inputs.packard.packages."${pkgs.system}".default
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ const { title, description, image, date, updated, tags } = Astro.props;
|
|||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en" class="scroll-smooth antialiased">
|
||||
<html lang="en" class="scroll-smooth antialiased" transition:animate="none">
|
||||
<Head
|
||||
title={title}
|
||||
description={description}
|
||||
|
@ -30,7 +30,10 @@ const { title, description, image, date, updated, tags } = Astro.props;
|
|||
class="flex min-h-screen flex-col justify-start bg-primary p-8 pt-0 text-secondary md:pt-8"
|
||||
>
|
||||
<Header />
|
||||
<main class="mx-auto w-full max-w-prose space-y-6">
|
||||
<main
|
||||
class="mx-auto w-full max-w-prose space-y-6"
|
||||
transition:animate="fade"
|
||||
>
|
||||
<slot />
|
||||
</main>
|
||||
<Footer />
|
||||
|
|
|
@ -23,6 +23,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.astro-code,
|
||||
.astro-code span {
|
||||
color: var(--shiki-dark) !important;
|
||||
background-color: var(--shiki-dark-bg) !important;
|
||||
/* Optional, if you also want font styles */
|
||||
font-style: var(--shiki-dark-font-style) !important;
|
||||
font-weight: var(--shiki-dark-font-weight) !important;
|
||||
text-decoration: var(--shiki-dark-text-decoration) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@layer components {
|
||||
.prose img {
|
||||
@apply cursor-pointer transition-transform hover:scale-[98%] active:scale-[200%];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue