-
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.
feat: functional practical info and faq framework
- Loading branch information
1 parent
e15fdfa
commit bf9198f
Showing
4 changed files
with
59 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
import type { FaqSnippet } from "../../types"; | ||
type Props = FaqSnippet; | ||
const { title, body } = Astro.props; | ||
--- | ||
|
||
<div> | ||
<h1 class="text-white text-4xl font-bold">{title}</h1> | ||
<div class="prose text-white" set:html={body} /> | ||
</div> |
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,26 @@ | ||
--- | ||
import type { InfoPage } from "../../types"; | ||
import FaqItem from "./FaqItem.astro"; | ||
import Intro from "../Intro.astro"; | ||
type Props = InfoPage; | ||
const { title, pages = [], faq = [], intro, body } = Astro.props; | ||
--- | ||
|
||
<div> | ||
<h1 class="text-white text-4xl font-bold">{title}</h1> | ||
{intro ? <Intro text={intro} /> : null} | ||
<div class="prose" set:html={body} /> | ||
{ | ||
pages.map(({ url, title }) => ( | ||
<> | ||
<a href={url} class="text-white"> | ||
{title} | ||
</a> | ||
<br /> | ||
</> | ||
)) | ||
} | ||
{faq.map((item) => <FaqItem {...item} />)} | ||
</div> |
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 |
---|---|---|
@@ -1,13 +1,28 @@ | ||
import type { MinimalApiPage } from "./utils"; | ||
|
||
export interface FaqSnippet { | ||
title: string; | ||
body?: string; | ||
url: string; | ||
} | ||
|
||
export interface InfoPageSnippet { | ||
title: string; | ||
url: string; | ||
} | ||
|
||
export interface InfoPage extends MinimalApiPage { | ||
meta: { | ||
url: string; | ||
} & MinimalApiPage["meta"]; | ||
title: string; | ||
body?: string; | ||
intro?: string; | ||
pages?: InfoPageSnippet[]; | ||
faq?: FaqSnippet[]; | ||
} | ||
|
||
export interface FaqPage extends MinimalApiPage { | ||
meta: { | ||
url: string; | ||
} & MinimalApiPage["meta"]; | ||
title: string; | ||
body?: string; | ||
} | ||
export interface FaqEntry extends MinimalApiPage {} |