refactor: extract a Markdown component
This commit is contained in:
parent
18a1dd0e03
commit
5c4e54152a
3
website/src/components/Markdown.astro
Normal file
3
website/src/components/Markdown.astro
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<div class="markdown">
|
||||||
|
<slot />
|
||||||
|
</div>
|
|
@ -1,15 +1,16 @@
|
||||||
---
|
---
|
||||||
import BaseLayout from './PageLayout.astro'
|
import BaseLayout from './PageLayout.astro'
|
||||||
import DailyEmailForm from '../components/DailyEmailForm.astro'
|
import DailyEmailForm from '../components/DailyEmailForm.astro'
|
||||||
|
import Markdown from '../components/Markdown.astro'
|
||||||
|
|
||||||
const { title } = Astro.props.frontmatter || Astro.props;
|
const { title } = Astro.props.frontmatter || Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout title={title}>
|
<BaseLayout title={title}>
|
||||||
<div class="space-y-16">
|
<div class="space-y-16">
|
||||||
<div class="markdown">
|
<Markdown>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</Markdown>
|
||||||
|
|
||||||
<DailyEmailForm />
|
<DailyEmailForm />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
---
|
---
|
||||||
import BaseLayout from './Layout.astro'
|
import BaseLayout from './Layout.astro'
|
||||||
|
import Markdown from '../components/Markdown.astro'
|
||||||
|
|
||||||
const { title } = Astro.props.frontmatter || Astro.props;
|
const { title } = Astro.props.frontmatter || Astro.props;
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout title={title}>
|
<BaseLayout title={title}>
|
||||||
<div class="markdown">
|
<Markdown>
|
||||||
<slot/>
|
<slot/>
|
||||||
</div>
|
</Markdown>
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
import Layout from '../../layouts/Layout.astro'
|
import Layout from '../../layouts/Layout.astro'
|
||||||
|
import Markdown from '../../components/Markdown.astro'
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const posts = await Astro.glob('../../posts/*.md')
|
const posts = await Astro.glob('../../posts/*.md')
|
||||||
|
@ -22,8 +23,8 @@ const { title } = Astro.props.post.frontmatter
|
||||||
|
|
||||||
<Layout title={title}>
|
<Layout title={title}>
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<div class="markdown">
|
<Markdown>
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</Markdown>
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
---
|
---
|
||||||
import Layout from '../../layouts/Layout.astro'
|
import Layout from '../../layouts/Layout.astro'
|
||||||
|
import Markdown from '../../components/Markdown.astro'
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const talks = await Astro.glob('../../talks/*.md')
|
const talks = await Astro.glob('../../talks/*.md')
|
||||||
|
@ -21,9 +22,9 @@ const { title, speakerdeck, video } = Astro.props.talk.frontmatter
|
||||||
|
|
||||||
<Layout title={title}>
|
<Layout title={title}>
|
||||||
<div class="space-y-6">
|
<div class="space-y-6">
|
||||||
<div class="markdown">
|
<Markdown>
|
||||||
<Content />
|
<Content />
|
||||||
</div>
|
</Markdown>
|
||||||
|
|
||||||
{speakerdeck && speakerdeck.id && (
|
{speakerdeck && speakerdeck.id && (
|
||||||
<div>
|
<div>
|
||||||
|
|
Loading…
Reference in a new issue