Sam Feldstein's Notebook
Main Site

Foam and Eleventy

Relative links

Relative links, as generated by Foam, don't work with 11ty's _site/ output.

Relative links in the source folder (eg ../recipes/cake.md) don't account for the build output's pretty link structure, which looks like this: _site/recipes/cake/index.html. The relative link can't account for that extra cake/ folder.

I don't think this is a private-notes-in-foam-and-eleventyoblem with Foam. I think it's a problem with SSGs and pretty urls . Luckily, Juan Frank figured out how to deal with it in his Eleventy Foam Template. The solution involves regex and Markdown-It.

Wikilinks

Eleventy (or any static site generator, probably) doesn't know what to do with wikilinks, so you have to tell it. Again, Juan Frank's solution was helpful here, but he didn't account for pipe notation (as far as I could tell). So a link like this [note-file-name|Note File Name] would render like that in the output.

With Claude's help, I added a regex that deletes the text to the left of the pipe.

Resources