Finish SSH apps post

This commit is contained in:
Bad Manners 2024-09-23 13:16:43 -03:00
parent 402698e9ca
commit 4043a2dad9
No known key found for this signature in database
GPG key ID: 8C88292CCB075609
132 changed files with 168 additions and 134 deletions

View file

@ -21,16 +21,19 @@ const nestedHeadings = headings.reduce((acc, heading) => {
let nextParent: NestedHeading = acc[acc.length - 1];
while (nextParent.depth < heading.depth) {
parent = nextParent;
if (!nextParent.children) {
nextParent.children = [];
if (!parent.children) {
break;
}
nextParent = nextParent.children[nextParent.children.length - 1];
nextParent = parent.children[parent.children.length - 1];
}
if (parent === null) {
acc.push({ ...heading });
} else {
parent.children!.push({ ...heading });
if (parent.children) {
parent.children.push({ ...heading });
} else {
parent.children = [{ ...heading }];
}
}
}
return acc;

View file

@ -12,7 +12,7 @@ const { slug, text, children } = Astro.props;
<li>
<a href={`#${slug}`}>{text}</a>
{
children ? (
children?.length ? (
<ul>
{children.map((child) => (
<Astro.self {...child} />