Skip to content

Commit f91a20f

Browse files
committed
Start adding butterfly 2.4 page
1 parent d28f300 commit f91a20f

File tree

10 files changed

+752
-659
lines changed

10 files changed

+752
-659
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
"astro": "astro"
1111
},
1212
"dependencies": {
13-
"@astrojs/mdx": "^4.2.6",
13+
"@astrojs/mdx": "^4.3.0",
1414
"@astrojs/rss": "^4.0.11",
1515
"@astrojs/sitemap": "^3.4.0",
1616
"@linwooddev/style": "^0.4.2",
1717
"@phosphor-icons/web": "^2.1.2",
18-
"astro": "^5.7.13",
18+
"astro": "^5.8.1",
1919
"sharp": "^0.34.2",
2020
"typescript": "^5.8.3"
2121
},
22-
"packageManager": "pnpm@10.11.0",
22+
"packageManager": "pnpm@10.11.1",
2323
"devDependencies": {
2424
"@vite-pwa/astro": "^1.1.0",
25-
"sass": "^1.89.0",
25+
"sass": "^1.89.1",
2626
"vite-plugin-pwa": "^1.0.0",
2727
"workbox-window": "^7.3.0"
2828
}

pnpm-lock.yaml

Lines changed: 642 additions & 623 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/blog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ export const getProject = async (
3030
export const PAGE_SIZE = 20;
3131

3232
export const getPosts = async () =>
33-
(await getCollection("blog")).sort(
33+
(await getCollection("blog")).filter((e) => !e.data.unlisted).sort(
3434
(a, b) => b.data.date.valueOf() - a.data.date.valueOf()
3535
);

src/components/Table.astro

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<ul class="table">
2+
<slot />
3+
</ul>
4+
5+
<style>
6+
.table {
7+
display: grid;
8+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
9+
gap: 1rem;
10+
grid-auto-rows: 1fr;
11+
list-style-type: none;
12+
padding: 0;
13+
justify-content: center;
14+
}
15+
</style>

src/components/TableItem.astro

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
import Link from "./Link.astro";
3+
4+
type Props = {
5+
href?: string;
6+
};
7+
8+
const { href } = Astro.props;
9+
---
10+
11+
<li class="table-item">
12+
<Link
13+
variant="secondary"
14+
href={href}
15+
class="col align-center justify-center h-full text-normal"
16+
>
17+
<slot />
18+
</Link>
19+
</li>
20+
21+
<style>
22+
.table-item {
23+
height: 100%;
24+
}
25+
</style>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Butterfly Black Hairstreak released
3+
date: "2025-05-21"
4+
author: codedoctor
5+
tags: [butterfly]
6+
slug: "butterfly/2.4"
7+
unlisted: true
8+
---
9+
10+
**Butterfly 2.4 Black Hairstreak is currently in beta!**
11+
12+
Please visit the nightly versions here:
13+
14+
- [2.4.0-beta.0](/butterfly/2.4.0-beta.0)
15+
16+
*This page is currently only a draft*
17+
18+
## Highlights
19+
20+
<Table>
21+
<TableItem href="#text-format">
22+
New Butterfly text format
23+
</TableItem>
24+
<TableItem href="#text-format">
25+
Rebuild pack system
26+
</TableItem>
27+
<TableItem href="#text-format">
28+
Improved Label Tool
29+
</TableItem>
30+
<TableItem href="#text-format">
31+
Improved Pen Element
32+
</TableItem>
33+
<TableItem href="#text-format">
34+
Improved Collaboration
35+
</TableItem>
36+
<TableItem href="#text-format">
37+
LateX Support
38+
</TableItem>
39+
<TableItem href="#text-format">
40+
Improved Pen Toolbar
41+
</TableItem>
42+
<TableItem href="#text-format">
43+
Coming Soon...
44+
</TableItem>
45+
<TableItem href="#text-format">
46+
Coming Soon...
47+
</TableItem>
48+
</Table>
49+
50+
## Text format

src/content/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const blog = defineCollection({
1313
.or(z.date())
1414
.transform((val) => new Date(val)),
1515
heroImage: z.string().optional(),
16+
unlisted: z.boolean().default(false),
1617
author: reference("authors"),
1718
}),
1819
});

src/pages/[...slug].astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { getCollection } from 'astro:content';
33
import type { CollectionEntry } from 'astro:content';
44
import BlogPost from '../layouts/BlogPost.astro';
55
import { getEntryProject, getEntryUrl } from '../blog';
6+
import Table from '@components/Table.astro';
7+
import TableItem from '@components/TableItem.astro';
68
79
export async function getStaticPaths() {
810
const posts = await getCollection('blog');
@@ -18,5 +20,5 @@ const { Content } = await post.render();
1820
---
1921

2022
<BlogPost {...post.data} project={project?.id}>
21-
<Content />
23+
<Content components={{Table, TableItem}} />
2224
</BlogPost>

src/pages/index.astro

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { getProjects } from "../blog";
77
import DefaultLayout from "../layouts/DefaultLayout.astro";
88
import Link from "@components/Link.astro";
99
import { getCollection } from "astro:content";
10+
import Table from "@components/Table.astro";
11+
import TableItem from "@components/TableItem.astro";
1012
1113
const projects = await getProjects();
1214
const libraries = await getCollection("libraries");
@@ -42,38 +44,18 @@ const libraries = await getCollection("libraries");
4244
}
4345
</ul>
4446
</section>
45-
<section class="long-section">
47+
<section class="long-section container-md">
4648
<h2 class="section-title">Libraries</h2>
4749
<p class="pb-md text-center">Useful libraries for developers that want to build their own software</p>
48-
<ul class="libraries-grid container-md">
50+
<Table>
4951
{
5052
libraries.map((e) => (
51-
<li>
52-
<Link
53-
variant="secondary"
54-
href={e.data.url}
55-
class="col align-center justify-center h-full text-normal"
56-
>
57-
<p class="text-center mb-none">{e.data.id}</p>
58-
<p class="normal text-center mt-none">{e.data.description}</p>
59-
</Link>
60-
</li>
53+
<TableItem>
54+
<p class="text-center mb-none">{e.data.id}</p>
55+
<p class="normal text-center mt-none">{e.data.description}</p>
56+
</TableItem>
6157
))
6258
}
63-
</ul>
59+
</Table>
6460
</section>
65-
<style>
66-
.libraries-grid {
67-
display: grid;
68-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
69-
gap: 1rem;
70-
grid-auto-rows: 1fr;
71-
list-style-type: none;
72-
padding: 0;
73-
}
74-
75-
.libraries-grid li {
76-
height: 100%;
77-
}
78-
</style>
7961
</DefaultLayout>

src/pages/rss.xml.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import rss from "@astrojs/rss";
22
import type { APIContext } from "astro";
3-
import { getCollection } from "astro:content";
43
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
5-
import { getEntryUrl } from "src/blog";
4+
import { getEntryUrl, getPosts } from "src/blog";
65

76
export async function GET(context: APIContext) {
8-
const posts = await getCollection("blog");
7+
const posts = await getPosts();
98
return rss({
109
title: SITE_TITLE,
1110
description: SITE_DESCRIPTION,

0 commit comments

Comments
 (0)