tangled
alpha
login
or
join now
claycow.com
/
claycow
0
fork
atom
A Astro blog hosted on Vercel
0
fork
atom
overview
issues
pulls
pipelines
allow spam cow
Clayton Cook
6 months ago
4bcc66eb
d959dff6
1/1
deploy.yaml
success
52s
+30
-16
3 changed files
expand all
collapse all
unified
split
src
components
Navigation.astro
layouts
BlogPost.astro
pages
blog
[...slug].astro
+17
-3
src/components/Navigation.astro
reviewed
···
8
8
9
9
homeLink?.addEventListener('click', (event) => {
10
10
event.preventDefault();
11
11
-
mooAudio?.addEventListener('ended', function () {
12
12
-
const anchor = event.target as HTMLAnchorElement;
11
11
+
12
12
+
const anchor = event.target as HTMLAnchorElement;
13
13
+
14
14
+
if (!mooAudio) {
13
15
window.location.href = anchor.href;
14
14
-
});
16
16
+
return;
17
17
+
}
18
18
+
19
19
+
mooAudio.currentTime = 0;
20
20
+
mooAudio?.addEventListener(
21
21
+
'ended',
22
22
+
function () {
23
23
+
window.location.href = anchor.href;
24
24
+
},
25
25
+
{
26
26
+
once: true,
27
27
+
}
28
28
+
);
15
29
mooAudio?.play();
16
30
});
17
31
</script>
+6
-6
src/layouts/BlogPost.astro
reviewed
···
1
1
---
2
2
-
import type { CollectionEntry } from "astro:content";
2
2
+
import type { CollectionEntry } from 'astro:content';
3
3
import {
4
4
Head,
5
5
Footer,
···
7
7
BlueskyComments,
8
8
BandcampWishlist,
9
9
LiberaPayDonate,
10
10
-
} from "@/components";
11
11
-
import { formatDate } from "@/utils";
12
12
-
import { Image } from "astro:assets";
10
10
+
} from '@/components';
11
11
+
import { formatDate } from '@/utils';
12
12
+
import { Image } from 'astro:assets';
13
13
14
14
-
type Props = CollectionEntry<"blog">["data"];
14
14
+
type Props = CollectionEntry<'blog'>['data'];
15
15
16
16
const { title, description, date, updatedDate, image } = Astro.props;
17
17
---
···
75
75
alt={image.alt}
76
76
width={1020}
77
77
height={510}
78
78
-
loading={"lazy"}
78
78
+
loading={'lazy'}
79
79
/>
80
80
)
81
81
}
+7
-7
src/pages/blog/[...slug].astro
reviewed
···
1
1
---
2
2
-
import { type CollectionEntry, getCollection } from "astro:content";
3
3
-
import { BlogPostLayout } from "@/layouts";
4
4
-
import { render } from "astro:content";
2
2
+
import { type CollectionEntry, getCollection } from 'astro:content';
3
3
+
import { BlogPostLayout } from '@/layouts';
4
4
+
import { render } from 'astro:content';
5
5
6
6
export async function getStaticPaths() {
7
7
-
const posts = await getCollection("blog");
7
7
+
const posts = await getCollection('blog');
8
8
return posts
9
9
.filter(
10
10
(post) =>
11
11
-
import.meta.env.ENVIRONMENT === "preview" ||
11
11
+
import.meta.env.ENVIRONMENT === 'preview' ||
12
12
Boolean(post.data.isPublished)
13
13
)
14
14
.map((post) => ({
15
15
params: {
16
16
-
slug: post.data.title.toLowerCase().replaceAll(" ", "-"),
16
16
+
slug: post.data.title.toLowerCase().replaceAll(' ', '-'),
17
17
},
18
18
props: post,
19
19
}));
20
20
}
21
21
-
type Props = CollectionEntry<"blog">;
21
21
+
type Props = CollectionEntry<'blog'>;
22
22
23
23
const post = Astro.props;
24
24
const { Content } = await render(post);