This commit is contained in:
Adrian Altner 2026-04-21 01:26:19 +02:00
commit f9ab31c247
62 changed files with 7894 additions and 0 deletions

View file

@ -0,0 +1,21 @@
---
import { type CollectionEntry, render } from 'astro:content';
import Post from '~/layouts/Post.astro';
import { getPostsByLocale, postSlug } from '~/i18n/posts';
export async function getStaticPaths() {
const posts = await getPostsByLocale('en');
return posts.map((post) => ({
params: { slug: postSlug(post) },
props: post,
}));
}
type Props = CollectionEntry<'posts'>;
const post = Astro.props;
const { Content } = await render(post);
---
<Post {...post.data} locale="en" entry={post}>
<Content />
</Post>

14
src/pages/en/about.astro Normal file
View file

@ -0,0 +1,14 @@
---
import AboutHeroImage from '~/assets/blog-placeholder-about.jpg';
import Layout from '~/layouts/Post.astro';
---
<Layout
title="About Me"
description="Short introduction."
pubDate={new Date('August 08 2021')}
heroImage={AboutHeroImage}
locale="en"
>
<p>This is the English version of the about page.</p>
</Layout>

View file

@ -0,0 +1,5 @@
---
import CategoriesPage from '~/components/CategoriesPage.astro';
---
<CategoriesPage locale="en" />

View file

@ -0,0 +1,18 @@
---
import type { CollectionEntry } from 'astro:content';
import CategoryDetailPage from '~/components/CategoryDetailPage.astro';
import { entrySlug, getCategoriesByLocale } from '~/i18n/posts';
export async function getStaticPaths() {
const categories = await getCategoriesByLocale('en');
return categories.map((category) => ({
params: { slug: entrySlug(category) },
props: { category },
}));
}
type Props = { category: CollectionEntry<'categories'> };
const { category } = Astro.props;
---
<CategoryDetailPage locale="en" category={category} />

5
src/pages/en/index.astro Normal file
View file

@ -0,0 +1,5 @@
---
import HomePage from '~/components/HomePage.astro';
---
<HomePage locale="en" />

16
src/pages/en/rss.xml.js Normal file
View file

@ -0,0 +1,16 @@
import rss from '@astrojs/rss';
import { SITE } from '~/consts';
import { getPostsByLocale, postSlug } from '~/i18n/posts';
export async function GET(context) {
const posts = await getPostsByLocale('en');
return rss({
title: SITE.en.title,
description: SITE.en.description,
site: context.site,
items: posts.map((post) => ({
...post.data,
link: `/en/${postSlug(post)}/`,
})),
});
}

View file

@ -0,0 +1,13 @@
---
import TagDetailPage from '~/components/TagDetailPage.astro';
import { getTagsByLocale } from '~/i18n/posts';
export async function getStaticPaths() {
const tags = await getTagsByLocale('en');
return tags.map((tag) => ({ params: { slug: tag.slug }, props: { tag } }));
}
const { tag } = Astro.props;
---
<TagDetailPage locale="en" tag={tag} />

5
src/pages/en/tags.astro Normal file
View file

@ -0,0 +1,5 @@
---
import TagsPage from '~/components/TagsPage.astro';
---
<TagsPage locale="en" />