Added general content blocks
This commit is contained in:
23
src/components/markdoc/blocks/general/FootnoteList.astro
Normal file
23
src/components/markdoc/blocks/general/FootnoteList.astro
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
import Node from '@/components/markdoc/Node.astro'
|
||||
import type { Footnote } from '@/lib/markdoc/types'
|
||||
|
||||
type Props = { footnotes: Footnote[] }
|
||||
const { footnotes } = Astro.props
|
||||
---
|
||||
|
||||
{footnotes.length > 0 && (
|
||||
<section class="footnotes">
|
||||
<h2 class="footnotes__title">Notes</h2>
|
||||
<ol>
|
||||
{footnotes.map((footnote) => (
|
||||
<li id={`fn-${footnote.n}`}>
|
||||
<Node node={footnote.children} />{' '}
|
||||
<a href={`#fnref-${footnote.n}`} class="footnotes__back" aria-label="Back to text">
|
||||
↩
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</section>
|
||||
)}
|
||||
Reference in New Issue
Block a user