site.ori/links: simplify

This commit is contained in:
Hans Fast 2026-03-11 15:33:46 +01:00
parent 3c05b4cc72
commit 608cf49c1b
1 changed files with 2 additions and 3 deletions

View File

@ -10,9 +10,8 @@
spread the final result of this closure into the parent tree. spread the final result of this closure into the parent tree.
*/ */
...{ ...{
hast = Tree.map(pages, getLinkedFilesFromHtml.js) links: Tree.map(pages, getLinkedFilesFromHtml.js)
//the [...new Set()] construct filters out duplicates → (links) => Tree.flat(links, 2) → (a) => [...new Set(a)]
links: Tree.flat(hast, 2) → (a) => [...new Set(a)]
//linksAsTree is a nested object representation of the paths. //linksAsTree is a nested object representation of the paths.
//can use that object as a mask on all to get a 'filtered' tree. //can use that object as a mask on all to get a 'filtered' tree.