feat: 修改部署方式
This commit is contained in:
@@ -1,9 +1,33 @@
|
||||
---
|
||||
import Layout from '@/layouts/Layout.astro';
|
||||
import Layout from "@/layouts/Layout.astro";
|
||||
|
||||
import Demo from '@/components/Demo.tsx';
|
||||
const posts = [
|
||||
{
|
||||
title: "First Post",
|
||||
date: "2024-01-01",
|
||||
summary: "This is the summary of the first post.",
|
||||
},
|
||||
];
|
||||
---
|
||||
|
||||
<Layout>
|
||||
<Demo client:only/>
|
||||
<div>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<a href={`/posts/${post.title.replace(/\s+/g, "-").toLowerCase()}`}>
|
||||
<h2>{post.title}</h2>
|
||||
<p>{post.date}</p>
|
||||
<p class="summary">{post.summary}</p>
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
<style>
|
||||
.summary {
|
||||
line-height: 2;
|
||||
font-size: 16px;
|
||||
color: rgb(66, 63, 63);
|
||||
}
|
||||
</style>
|
||||
|
||||
9
src/pages/posts/[...slug].astro
Normal file
9
src/pages/posts/[...slug].astro
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
import Layout from "@/layouts/Layout.astro";
|
||||
|
||||
|
||||
---
|
||||
|
||||
<Layout>
|
||||
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user