ori-include-linked-paths/site.ori

27 lines
659 B
Plaintext

{
(pages): {
./linked-image.html
./linked-stylesheet.html
}
...pages/
/*
spread the final result of this closure into the parent tree.
*/
...{
hast = Tree.map(pages, getLinkedFilesFromHtml.js)
//the [...new Set()] construct filters out duplicates
links: Tree.flat(hast, 2) → (a) => [...new Set(a)]
//linksAsTree is a nested object representation of the paths.
//can use that object as a mask on all to get a 'filtered' tree.
linksAsTree: pathsToObjs.js(links)
onlyLinkedFiles: Tree.mask(<.>, linksAsTree)
}.onlyLinkedFiles
index.html: page.ori.html(Origami.mdHtml(Origami.inline(README.md)))
}