升级
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
import { galleryIntro, photos } from "../data/photos";
|
||||
import { galleryIntro, photoTopics } from "../data/photos";
|
||||
import { site } from "../data/site";
|
||||
---
|
||||
|
||||
@@ -19,16 +19,17 @@ import { site } from "../data/site";
|
||||
<div class="section-inner">
|
||||
<div class="photo-grid page-grid">
|
||||
{
|
||||
photos.map((photo) => (
|
||||
<article
|
||||
class="photo-card"
|
||||
style={photo.image ? `--photo-image: url("${photo.image}")` : ""}
|
||||
photoTopics.map((topic) => (
|
||||
<a
|
||||
class="photo-card topic-card"
|
||||
href={`/gallery/${topic.slug}/`}
|
||||
style={topic.cover ? `--photo-image: url("${topic.cover}")` : ""}
|
||||
>
|
||||
<div>
|
||||
<strong>{photo.title}</strong>
|
||||
<span>{photo.text}</span>
|
||||
<strong>{topic.title}</strong>
|
||||
<span>{topic.text}</span>
|
||||
</div>
|
||||
</article>
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
import { galleryIntro, photoTopics } from "../../data/photos";
|
||||
import { site } from "../../data/site";
|
||||
|
||||
export function getStaticPaths() {
|
||||
return photoTopics.map((topic) => ({
|
||||
params: { slug: topic.slug },
|
||||
props: { topic }
|
||||
}));
|
||||
}
|
||||
|
||||
const { topic } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={`${topic.title} · ${galleryIntro.title} · ${site.className}`}>
|
||||
<main class="page-main">
|
||||
<section class="page-hero">
|
||||
<div class="section-inner">
|
||||
<a class="back-link" href="/gallery/">返回照片墙</a>
|
||||
<p class="eyebrow">Photo Topic</p>
|
||||
<h1>{topic.title}</h1>
|
||||
<p>{topic.text}</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="gallery-band scrapbook-section">
|
||||
<div class="section-inner">
|
||||
<div class="scrapbook">
|
||||
{
|
||||
topic.photos.map((photo) => (
|
||||
<article
|
||||
class="scrap-photo"
|
||||
style={photo.image ? `--scrap-image: url("${photo.image}")` : ""}
|
||||
>
|
||||
<div class="scrap-frame">
|
||||
<div class="scrap-image" aria-hidden="true"></div>
|
||||
<div class="scrap-copy">
|
||||
<strong>{photo.title}</strong>
|
||||
<span>{photo.caption}</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</BaseLayout>
|
||||
+10
-9
@@ -1,13 +1,13 @@
|
||||
---
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
import { galleryIntro, photos } from "../data/photos";
|
||||
import { galleryIntro, photoTopics } from "../data/photos";
|
||||
import { featuredMessage, messages, messagesIntro } from "../data/messages";
|
||||
import { people, peopleIntro } from "../data/people";
|
||||
import { site, stats } from "../data/site";
|
||||
import { timeline, timelineIntro } from "../data/timeline";
|
||||
|
||||
const previewTimeline = timeline.slice(0, 4);
|
||||
const previewPhotos = photos.slice(0, 4);
|
||||
const previewPhotoTopics = photoTopics.slice(0, 4);
|
||||
const previewPeople = people.slice(0, 6);
|
||||
---
|
||||
|
||||
@@ -74,16 +74,17 @@ const previewPeople = people.slice(0, 6);
|
||||
|
||||
<div class="photo-grid">
|
||||
{
|
||||
previewPhotos.map((photo) => (
|
||||
<article
|
||||
class="photo-card"
|
||||
style={photo.image ? `--photo-image: url("${photo.image}")` : ""}
|
||||
previewPhotoTopics.map((topic) => (
|
||||
<a
|
||||
class="photo-card topic-card"
|
||||
href={`/gallery/${topic.slug}/`}
|
||||
style={topic.cover ? `--photo-image: url("${topic.cover}")` : ""}
|
||||
>
|
||||
<div>
|
||||
<strong>{photo.title}</strong>
|
||||
<span>{photo.text}</span>
|
||||
<strong>{topic.title}</strong>
|
||||
<span>{topic.text}</span>
|
||||
</div>
|
||||
</article>
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user