Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
andyluss committed Jul 10, 2024
1 parent 381adb3 commit 59be8c3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/layouts/ContentLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import FormattedDate from "../components/FormattedDate.astro";
type Props = CollectionEntry<"blog">["data"];
interface Props {
post: CollectionEntry<"blog">;
}
const { title, tags, level, description, pubDate, updatedDate, heroImage } =
Astro.props;
const {
slug,
collection,
data: { title, tags, level, description, pubDate, updatedDate, heroImage },
} = Astro.props.post;
---

<html lang="en">
Expand Down Expand Up @@ -79,6 +84,12 @@ const { title, tags, level, description, pubDate, updatedDate, heroImage } =
<hr />
</div>
<slot />
<a
href={`https://github.com/andyluss/lushisang.com/edit/main/src/content/${collection}/${slug}.md`}
class="text-sm underline"
>
编辑>>
</a>
</div>
</article>
</main>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/xyy/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ const post = Astro.props;
const { Content } = await post.render();
---

<ContentLayout {...post.data}>
<ContentLayout post={post}>
<Content />
</ContentLayout>

0 comments on commit 59be8c3

Please sign in to comment.