init
This commit is contained in:
commit
f9ab31c247
62 changed files with 7894 additions and 0 deletions
21
src/pages/en/[...slug].astro
Normal file
21
src/pages/en/[...slug].astro
Normal 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
14
src/pages/en/about.astro
Normal 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>
|
||||
5
src/pages/en/categories.astro
Normal file
5
src/pages/en/categories.astro
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
import CategoriesPage from '~/components/CategoriesPage.astro';
|
||||
---
|
||||
|
||||
<CategoriesPage locale="en" />
|
||||
18
src/pages/en/category/[slug].astro
Normal file
18
src/pages/en/category/[slug].astro
Normal 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
5
src/pages/en/index.astro
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
import HomePage from '~/components/HomePage.astro';
|
||||
---
|
||||
|
||||
<HomePage locale="en" />
|
||||
16
src/pages/en/rss.xml.js
Normal file
16
src/pages/en/rss.xml.js
Normal 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)}/`,
|
||||
})),
|
||||
});
|
||||
}
|
||||
13
src/pages/en/tag/[slug].astro
Normal file
13
src/pages/en/tag/[slug].astro
Normal 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
5
src/pages/en/tags.astro
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
import TagsPage from '~/components/TagsPage.astro';
|
||||
---
|
||||
|
||||
<TagsPage locale="en" />
|
||||
Loading…
Add table
Add a link
Reference in a new issue