add: wikibonsai changes.

This commit is contained in:
manunamz
2023-10-03 10:58:17 -04:00
parent 8e2152a560
commit f87f774b2a
26 changed files with 4811 additions and 54 deletions
+25
View File
@@ -0,0 +1,25 @@
---
import { getCollection } from 'astro:content';
import { SITE_TITLE } from '../consts';
import { bonsai } from '../wikibonsai/semtree';
const { nodes } = Astro.props;
const root = bonsai ? bonsai.root : '';
const tree = bonsai ? bonsai.tree : [];
---
<!-- from: https://stackoverflow.com/questions/74126716/how-to-self-reference-astro-component -->
<ul class="branch">
{nodes.map(node =>
<li>
{node.url ?
<a class="wiki" href={node.url}>{node.text}</a>
:
<a class="invalid">{node.text}</a>
}
<Astro.self nodes={node.children.map(child =>
tree.find(treeNode => treeNode.text == child)
)} />
</li>
)}
</ul>