generated from satnaing/astro-paper
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Daveed
committed
Oct 30, 2024
1 parent
6c1365b
commit e79ea0a
Showing
8 changed files
with
126 additions
and
137 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
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,5 @@ | ||
import type Store from './Store'; | ||
import type Page from './Page'; | ||
import type Product from './Product'; | ||
|
||
export type { Store, Page, Product }; |
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,48 @@ | ||
--- | ||
import { type CollectionEntry, getCollection } from "astro:content"; | ||
import type { Page, Store } from "@interfaces/index"; | ||
import { | ||
BlocksRenderer, | ||
type BlocksContent, | ||
} from "@strapi/blocks-react-renderer"; | ||
import Layout from "@layouts/Layout.astro"; | ||
import Header from "@components/Header.astro"; | ||
import Footer from "@components/Footer.astro"; | ||
import Breadcrumbs from "@components/Breadcrumbs.astro"; | ||
import Hr from "@components/Hr.astro"; | ||
export interface Props { | ||
page: CollectionEntry<"page">; | ||
} | ||
export async function getStaticPaths() { | ||
const pages = await getCollection("pages"); | ||
return pages.map((page: { data: CollectionEntry<"page"> }) => ({ | ||
params: { slug: page.data.slug }, | ||
props: { page: page.data }, | ||
})); | ||
} | ||
const stores = await getCollection("stores"); | ||
const store = stores?.[0]?.data as unknown as Store; | ||
const { page } = Astro.props; | ||
--- | ||
|
||
<Layout> | ||
<Header store={store} activeNav={page.slug} /> | ||
|
||
<Breadcrumbs /> | ||
<main id="main-content"> | ||
<section id="about" class="mb-10 max-w-3xl prose-img:border-0"> | ||
<h1 class="text-2xl tracking-wider sm:text-3xl">{page.Title}</h1> | ||
</section> | ||
|
||
<section class=""> | ||
<BlocksRenderer content={page?.Content || ([] as BlocksContent[])} /> | ||
</section> | ||
<Hr /> | ||
</main> | ||
</Layout> | ||
<Footer /> |
This file was deleted.
Oops, something went wrong.
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