feat: implement barebone zola templates
This commit is contained in:
parent
9c20f5ed2e
commit
f99a9ae2ac
198 changed files with 2434 additions and 227991 deletions
0
_src/components/Toc/Toc.module.css
Normal file
0
_src/components/Toc/Toc.module.css
Normal file
26
_src/components/Toc/Toc.tsx
Normal file
26
_src/components/Toc/Toc.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import React from 'react';
|
||||
import type { MarkdownHeading } from 'astro';
|
||||
// import styles from './Toc.module.css';
|
||||
|
||||
interface Props {
|
||||
headings: MarkdownHeading[];
|
||||
}
|
||||
|
||||
// TODO: Change this for the floating container with Intersection Observer
|
||||
// FIXME: Create real nesting and not the ilussion of nesting (aka nested ul and not padding multiplied by depth)
|
||||
export default function Toc({ headings }: Props): JSX.Element {
|
||||
return (
|
||||
<ul className="mb-3">
|
||||
{headings.map((item, idx) => (
|
||||
<li
|
||||
key={idx}
|
||||
style={{ paddingLeft: item.depth > 1 ? 20 * item.depth : 0 }}
|
||||
>
|
||||
<a href={`#${item.slug}`}>
|
||||
{item.depth} - {item.text}
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue