This commit is contained in:
2025-11-26 13:48:13 +08:00
commit 82a13f4aad
62 changed files with 10778 additions and 0 deletions

34
src/pages/en/about.astro Normal file
View File

@@ -0,0 +1,34 @@
---
import MainLayout from '../../layouts/MainLayout.astro';
import { Content as AboutPage } from '../../content/about.md';
import siteConfig from '../../../site.config.mjs';
const profileImage = siteConfig.profileImage;
const base = import.meta.env.BASE_URL;
---
<MainLayout title="About" lang="en">
<section class="pt-32 pb-20">
<div class="container-custom">
<div class="max-w-2xl mx-auto text-center mb-16">
<h1 class="text-4xl md:text-5xl font-bold mb-4">About Me</h1>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-16 items-center">
<div>
<img
src=`${base}/images/${profileImage}`
alt="Profile image"
class="w-full h-auto rounded-lg shadow-lg border-8 my-4 border-white md:p-4"
width="720"
height="720"
/>
</div>
<div class="prose text-gray-700 mb-6">
<AboutPage />
</div>
</div>
</div>
</section>
</MainLayout>

View File

@@ -0,0 +1,62 @@
---
// 路径修正:同样是向上三级
import MainLayout from '../../../layouts/MainLayout.astro';
import PhotoGrid from '../../../components/PhotoGrid.astro';
import { getCollections, getImages } from '../../../data/imageStore';
// 英文版保持 'All'
const allCollection = {
id: undefined,
name: 'All',
};
const collections = [allCollection, ...(await getCollections())];
const { collection } = Astro.params;
const images = await getImages(collection ? { collection } : {});
const base = import.meta.env.BASE_URL;
export const getStaticPaths = async () => {
return [{ id: undefined }, ...(await getCollections())].map((collection) => {
return {
params: { collection: collection.id },
};
});
};
// 英文前缀
const langPrefix = '/en';
---
<MainLayout lang="en">
<section class="py-16 pt-24">
<div class="container-custom">
<div class="mb-16 text-center">
<h1 class="text-4xl md:text-5xl font-bold mb-4">Gallery</h1>
<p class="text-gray-600 max-w-xl mx-auto">Explore my collection of photographic works</p>
</div>
<div class="flex justify-center mb-10">
<div class="flex flex-wrap gap-2 justify-center">
{
collections.map((collectionBtn) => (
<a href={`${base}${langPrefix}/collections/${collectionBtn.id ? collectionBtn.id : ''}`}>
<div
class={`px-4 py-2 border rounded-full text-sm font-medium transition-all ${
collectionBtn.id === collection
? 'border-black bg-black text-white'
: 'border-gray-200 text-gray-700 hover:border-black'
}`}
>
{collectionBtn.name}
</div>
</a>
))
}
</div>
</div>
<PhotoGrid images={images} />
</div>
</section>
</MainLayout>

37
src/pages/en/index.astro Normal file
View File

@@ -0,0 +1,37 @@
---
import siteConfig from '../../../site.config.mjs';
import MainLayout from '../../layouts/MainLayout.astro';
import LandingHero from '../../components/LandingHero-1.astro';
import HeroBackground from '../../components/HeroBackground.astro';
import FeaturedGallery from '../../components/FeaturedGallery.astro';
import FeaturedWorkScroll from '../../components/FeaturedWorkScroll.astro';
const base = import.meta.env.BASE_URL;
const owner = siteConfig.owner;
---
<MainLayout lang="en">
<section class="relative min-h-screen flex flex-col justify-center py-20 md:py-16 overflow-hidden">
<HeroBackground />
<LandingHero
title={`${owner} Photography`}
subtitle="A place to showcase my photography"
btnText="View Gallery"
// 修改前: btnLink={`${base}/en/collections`}
// 修改后: 加一个 /
btnLink={`${base}/en/collections`}
/>
<div class="relative z-20 mt-12">
<FeaturedWorkScroll />
</div>
</section>
<section class="featured-section py-20">
<FeaturedGallery
title="Featured Works"
subtitle="A selection of my best photographs from various adventures"
/>
</section>
</MainLayout>