Skip to content

Commit

Permalink
[feat]: Author profile pages added
Browse files Browse the repository at this point in the history
  • Loading branch information
iamBijoyKar committed Jun 10, 2024
1 parent a04979f commit 3e977d4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/layouts/AuthorLayout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
import PageLayout from "./PageLayout.astro";
const {
data: {
name,
headlines,
about,
skills,
college,
profileImgLink,
links,
articleCount,
},
} = Astro.props;
---

<PageLayout title={name}>
<div class="w-full max-w-[800px] py-4 mx-auto">
<p class="">Hi Author</p>
</div>
</PageLayout>
17 changes: 17 additions & 0 deletions src/pages/authors/[...slug].astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
import { getCollection } from "astro:content";
import AuthorLayout from "@/layouts/AuthorLayout.astro";
export async function getStaticPaths() {
const posts = await getCollection("authors");
return posts.map((post) => ({
params: { slug: post.id },
props: post,
}));
}
const props = Astro.props;
const { slug } = Astro.params;
---

<AuthorLayout {...props} {slug} />
2 changes: 1 addition & 1 deletion src/pages/authors.astro → src/pages/authors/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AuthorSearch from "@/components/Author/AuthorSearch.svelte";
const authors = await getCollection("authors");
console.log(authors);
// console.log(authors);
---

<PageLayout title="Authors | Bijoy Kar">
Expand Down

0 comments on commit 3e977d4

Please sign in to comment.