+6
-2
src/components/Base.astro
+6
-2
src/components/Base.astro
···
4
banner?: string;
5
graph?: {
6
description: string;
7
-
url: string;
8
type?: "website" | "article";
9
};
10
}
···
27
<meta name="description" content={graph.description} />
28
<meta property="og:title" content={title} />
29
<meta property="og:description" content={graph.description} />
30
-
<meta property="og:url" content={graph.url} />
31
<meta property="og:type" content={graph.type ?? "website"} />
32
<meta property="og:image" content={banner} />
33
</Fragment>
···
4
banner?: string;
5
graph?: {
6
description: string;
7
type?: "website" | "article";
8
};
9
}
···
26
<meta name="description" content={graph.description} />
27
<meta property="og:title" content={title} />
28
<meta property="og:description" content={graph.description} />
29
+
<meta
30
+
property="og:url"
31
+
content={
32
+
"https://entomoviscera.online" + Astro.url.pathname.toString()
33
+
}
34
+
/>
35
<meta property="og:type" content={graph.type ?? "website"} />
36
<meta property="og:image" content={banner} />
37
</Fragment>
+27
src/components/BlogPost.astro
+27
src/components/BlogPost.astro
···
···
1
+
---
2
+
const { url, title, time } = Astro.props;
3
+
---
4
+
5
+
<a href={url}>
6
+
<article>
7
+
<h3>{title}</h3>
8
+
<time class="barcodetext" datetime={time}>{time}</time>
9
+
</article>
10
+
</a>
11
+
12
+
<style>
13
+
a {
14
+
display: block;
15
+
border: 10px double;
16
+
text-decoration: none;
17
+
}
18
+
19
+
article {
20
+
padding: 13px 15px;
21
+
}
22
+
23
+
time {
24
+
font-weight: bold;
25
+
font-size: 2rem;
26
+
}
27
+
</style>
+9
src/content/blog/v01.md
+9
src/content/blog/v01.md
···
···
1
+
---
2
+
title: Site update V0.1
3
+
bio: Website update log.
4
+
pub: 2025-10-31
5
+
---
6
+
7
+
Hello world. Currently there isn't much to see here but at least now there's blog posts. Learning how to use astro. It's the framework I'm currently using to make this site. So far it's not too bad actually.
8
+
9
+
God have mercy for my code is utterly garbage but at least I have the audacity to make it public.
+13
src/content/config.ts
+13
src/content/config.ts
···
···
1
+
import { defineCollection, z } from "astro:content";
2
+
import { glob } from "astro/loaders";
3
+
4
+
const blog = defineCollection({
5
+
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
6
+
schema: z.object({
7
+
title: z.string(),
8
+
bio: z.string(),
9
+
pub: z.date(),
10
+
}),
11
+
});
12
+
13
+
export const collections = { blog };
+57
src/pages/blog/[slug].astro
+57
src/pages/blog/[slug].astro
···
···
1
+
---
2
+
import { getCollection, render } from "astro:content";
3
+
import Base from "../../components/Base.astro";
4
+
import "../../styles/main.css";
5
+
6
+
export async function getStaticPaths() {
7
+
const posts = await getCollection("blog");
8
+
return posts.map((post) => ({
9
+
params: { slug: post.id },
10
+
props: { post },
11
+
}));
12
+
}
13
+
14
+
const { post } = Astro.props;
15
+
const { Content } = await render(post);
16
+
---
17
+
18
+
<Base
19
+
title={`LOG_${post.data.pub.getFullYear()}-${post.data.pub.getMonth() + 1}-${post.data.pub.getDate()} | ${post.data.title}`}
20
+
graph={{
21
+
description: post.data.bio,
22
+
type: "article",
23
+
}}
24
+
>
25
+
<article class="bwcontainer">
26
+
<header class="bwbox center">
27
+
<h1>{post.data.title}</h1>
28
+
<time
29
+
class="barcodetext"
30
+
datetime={`${post.data.pub.getFullYear()}-${post.data.pub.getMonth() + 1}-${post.data.pub.getDate()}`}
31
+
>
32
+
{
33
+
`${post.data.pub.getFullYear()}-${post.data.pub.getMonth() + 1}-${post.data.pub.getDate()}`
34
+
}
35
+
</time>
36
+
</header>
37
+
<div class="bwbox">
38
+
<Content />
39
+
</div>
40
+
</article>
41
+
</Base>
42
+
43
+
<style>
44
+
h1 {
45
+
margin-bottom: 13px;
46
+
}
47
+
48
+
time {
49
+
font-weight: bold;
50
+
font-size: 2.5rem;
51
+
}
52
+
53
+
article {
54
+
max-width: 82ch;
55
+
margin: 0 auto;
56
+
}
57
+
</style>
+15
-3
src/pages/home.astro
+15
-3
src/pages/home.astro
···
1
---
2
import Base from "../components/Base.astro";
3
import "../styles/main.css";
4
---
5
6
<Base
7
title="HOME"
8
graph={{
9
description: "WARNING: Bug inside.",
10
-
url: "https://entomoviscera.online/home",
11
}}
12
>
13
<div class="bwcontainer wrapper">
14
<header class="bwbox center flex">
15
-
<h1>ENTOMOVISCERA.ONLINE</h1>
16
<a href="/">
17
<img src="/img/icons/poweroff.png" alt="return to landing page" />
18
</a>
···
23
</div>
24
<div id="blog" class="bwbox">
25
<h2>Latest blog post</h2>
26
-
<p>Under construction. Come back later.</p>
27
</div>
28
</main>
29
</div>
···
1
---
2
+
import { getCollection } from "astro:content";
3
import Base from "../components/Base.astro";
4
+
import BlogPost from "../components/BlogPost.astro";
5
import "../styles/main.css";
6
+
7
+
const post = await getCollection("blog").then((x) =>
8
+
x.sort(
9
+
(a, b) =>
10
+
(b.data.pub as unknown as number) - (a.data.pub as unknown as number),
11
+
),
12
+
);
13
---
14
15
<Base
16
title="HOME"
17
graph={{
18
description: "WARNING: Bug inside.",
19
}}
20
>
21
<div class="bwcontainer wrapper">
22
<header class="bwbox center flex">
23
+
<h1 class="barcodetext">ENTOMOVISCERA.ONLINE</h1>
24
<a href="/">
25
<img src="/img/icons/poweroff.png" alt="return to landing page" />
26
</a>
···
31
</div>
32
<div id="blog" class="bwbox">
33
<h2>Latest blog post</h2>
34
+
<BlogPost
35
+
url={`/blog/${post[0].id}`}
36
+
title={post[0].data.title}
37
+
time={`${post[0].data.pub.getFullYear()}-${post[0].data.pub.getMonth() + 1}-${post[0].data.pub.getDate()}`}
38
+
/>
39
</div>
40
</main>
41
</div>
-1
src/pages/index.astro
-1
src/pages/index.astro
+9
-1
src/styles/main.css
+9
-1
src/styles/main.css