Contenu

Baldir

Marc Bouvier

Développeur logiciel en quête du sens dans un monde aux ressources limitées.

Ajout des id aux titres

Making-of

Ajout d’un plugin officiel qui génère des `id` pour les titres

Index: .eleventy.js

 import {eleventyImageTransformPlugin} from "@11ty/eleventy-img"
 import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight"
-import {EleventyHtmlBasePlugin, EleventyI18nPlugin} from "@11ty/eleventy";
+import {EleventyHtmlBasePlugin, EleventyI18nPlugin, IdAttributePlugin} from "@11ty/eleventy";
 import {feedPlugin} from "@11ty/eleventy-plugin-rss";
 import yaml from "js-yaml"
 
@@ -46,6 +46,8 @@
 
     });
 
+    // Adds id to headings
+    eleventyConfig.addPlugin(IdAttributePlugin);
 
     // Copy static styles as is
     eleventyConfig.addPassthroughCopy("public/css");