How To Make Eleventy Understand Obsidian-style Wiki Links
I have started to use Obsidian as my blog editor and because of that I needed a simple way to make eleventy understand wiki links like this:
[[eleventy-wikilinks|How To Make Eleventy Understand Obsidian-style Wiki Links]]
I first thought I would need to write my own code to make eleventy understand what this means, but as it turns out there exists a plugin for Eleventy that does this already.
First, install the plugin:
npm i @photogabble/eleventy-plugin-interlinker
Then, in your eleventy.config.js
:
//...
import interlinker from "@photogabble/eleventy-plugin-interlinker";
//...
export default async function(eleventyConfig) {
//...
eleventyConfig.addPlugin(interlinker);
//...
}
And that's already it. This plugin has a bunch of additional features (like backlinks), but this is all you need to make wiki links work.
With this setup you can write blog posts and interlink them using obsidians native linking capabilities and eleventy will understand what to do with those links as well. Pretty nice.
-
← Previous
DailyDogo 1241 🐶