-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1e9e47
commit cf5f14e
Showing
6 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
import MarkdownPostLayout from '../../layouts/MarkdownLayout.astro'; | ||
import { Image } from 'astro:assets'; | ||
import { getCollection } from 'astro:content'; | ||
export async function getStaticPaths() { | ||
const bookEntries = await getCollection('books'); | ||
return bookEntries.map((entry) => ({ | ||
params: { slug: entry.slug }, | ||
props: { entry }, | ||
})); | ||
} | ||
const { entry } = Astro.props; | ||
const { Content } = await entry.render(); | ||
--- | ||
|
||
<MarkdownPostLayout frontmatter={entry.data}> | ||
<Image src={entry.data.image} alt={entry.data.title} class="object-cover w-full h-full mb-6 rounded drop-shadow-lg" /> | ||
{ | ||
entry.data.store_urls && ( | ||
|
||
<b class="my-2 block">Buy a copy in the following places:</b> | ||
<ul class="list-disc list-inside m-2"> | ||
{entry.data.store_urls.map((store_url) => ( | ||
<li> | ||
<a href={store_url.url}>{store_url.label}</a> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
) | ||
} | ||
<Content /> | ||
</MarkdownPostLayout> |