SanYeCao-blog/src/pages/[lang]/about.astro

98 lines
1.7 KiB
Text
Raw Normal View History

2026-03-24 22:28:23 +00:00
---
import BaseLayout from "@/layouts/BaseLayout.astro";
import { getLangFromUrl, getTranslations } from "@/i18n";
import "@/styles/global.css";
export function getStaticPaths() {
return [{ params: { lang: "zh" } }, { params: { lang: "en" } }];
}
const lang = getLangFromUrl(Astro.url);
const t = getTranslations(lang);
const pageTitle = t.about.title;
---
2026-03-26 16:25:07 +00:00
<BaseLayout
pageTitle=`${pageTitle} - ${t.banner.title}`
2026-03-26 16:25:07 +00:00
image={t.about.profilePicture}
>
2026-09-17 08:16:27 +00:00
<div class="about page-shell">
2026-03-24 22:28:23 +00:00
<h1>{t.about.title}</h1>
<div class="intro">
<div class="intro-text">
<h2 class="name">{t.about.name}</h2>
<p class="slogan">{t.about.slogan}</p>
</div>
<img
src={t.about.profilePicture}
alt={t.about.name}
width="160"
class="avatar"
/>
</div>
<div class="content">
{t.about.content.map((line: string) => <p set:html={line} />)}
</div>
2026-09-17 08:16:27 +00:00
</div>
2026-03-24 22:28:23 +00:00
</BaseLayout>
<style>
.about {
2026-09-17 08:16:27 +00:00
padding-block: 2rem;
2026-03-24 22:28:23 +00:00
}
.about h1 {
font-size: 1.5rem;
}
.intro {
display: flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
margin-bottom: 2rem;
}
.intro-text {
flex: 1;
min-width: 0;
}
.name {
margin: 0 0 0.4rem 0;
font-size: 2rem;
font-weight: 700;
}
.slogan {
margin: 0;
color: gray;
font-style: italic;
}
.avatar {
display: block;
border-radius: 50%;
flex-shrink: 0;
}
.content p {
line-height: 1.8;
margin: 1rem 0;
}
.content a {
text-decoration: underline;
}
@media (max-width: 640px) {
.intro {
flex-direction: column-reverse;
align-items: flex-start;
}
}
</style>