Rewriting vimwiki links to match permalink #2826
Replies: 1 comment
-
If that's the form of the Markdown you have to work with, you will have to hook into the Markdown library to change the links yourself. See the Markdown section of the docs to see how to extend the underlying library, To obtain a mapping between the input path and the resulting URL, so that you know what to replace your links with, you could hook into a variety of places. You could try the (undocumented) let mapping = {};
config.on('eleventy.contentMap', function(map) {
mapping = map.inputPathToUrl;
});
// For debugging, log the content of our object
config.on('eleventy.after', function() {
console.log(mapping);
}); As you can see, it's all very do-it-yourself, but I hope these pointers set you on the right track. This is how I would attempt to do it, but without building and testing the full solution I'm not sure the timing works as expected. You'd have to check that Markdown rendering happens after you've received the entries to the |
Beta Was this translation helpful? Give feedback.
-
I am using vimwiki, which generates links using filenames, such as:
Link: [Digital Gardens](20230212203048.md)
Now I want to rewrite these links when 11ty saves out the html, to match the permalinks, which generally look something like this:
"permalink": "/essays/{{ title | slugify }}/"
Any suggestions are how to go about this? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions