generated from inherentlee/11ty
1 parent
66aba72fcc
commit
679b3b291e
3 files changed
+26
-6
No files matched your search
+12
-4
@@ -1,7 +1,10 @@
|
|||||||
import { attrs } from "@mdit/plugin-attrs";
|
|
||||||
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
||||||
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
||||||
|
|
||||||
|
import { attrs } from "@mdit/plugin-attrs";
|
||||||
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
||||||
|
import markdownitIdAttributes from "markdown-it-anchor";
|
||||||
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
|
||||||
import pluginFilters from "./_config/filters.js";
|
import pluginFilters from "./_config/filters.js";
|
||||||
@@ -11,7 +14,7 @@ export default async function (eleventyConfig) {
|
|||||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
|
||||||
|
|
||||||
/* Markdown apply target="_blank" to all external links */
|
/* Markdown apply target="_blank" to all external links */
|
||||||
const milaOptions = {
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, {
|
||||||
matcher(href) {
|
matcher(href) {
|
||||||
return href.match(/^https?:\/\//);
|
return href.match(/^https?:\/\//);
|
||||||
},
|
},
|
||||||
@@ -19,8 +22,13 @@ export default async function (eleventyConfig) {
|
|||||||
target: "_blank",
|
target: "_blank",
|
||||||
rel: "external",
|
rel: "external",
|
||||||
},
|
},
|
||||||
};
|
}));
|
||||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, milaOptions));
|
|
||||||
|
/* Markdown apply ID attributes to headers */
|
||||||
|
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitIdAttributes, {
|
||||||
|
level: [2, 3, 4],
|
||||||
|
tabIndex: false,
|
||||||
|
}));
|
||||||
|
|
||||||
/* Bundles */
|
/* Bundles */
|
||||||
/* CSS */
|
/* CSS */
|
||||||
|
|||||||
Generated
+13
-2
@@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "siblinghood-11ty",
|
"name": "siblinghood",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "siblinghood-11ty",
|
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -14,6 +13,7 @@
|
|||||||
"@11ty/eleventy-navigation": "^1.0.5",
|
"@11ty/eleventy-navigation": "^1.0.5",
|
||||||
"@mdit/plugin-attrs": "^0.25.1",
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
"luxon": "^3.7.2",
|
"luxon": "^3.7.2",
|
||||||
|
"markdown-it-anchor": "^10.0.0",
|
||||||
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1814,6 +1814,17 @@
|
|||||||
"markdown-it": "bin/markdown-it.mjs"
|
"markdown-it": "bin/markdown-it.mjs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/markdown-it-anchor": {
|
||||||
|
"version": "10.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-10.0.0.tgz",
|
||||||
|
"integrity": "sha512-Q8g7Z6OBdH3eXF0lujFqukIxUvgCDZcjzCrJxmD6QiEzU1HWR9fVN+Bf6gxmM+0yrPFs+jUw8gNjLmUQqt6Eew==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Unlicense",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@types/markdown-it": "*",
|
||||||
|
"markdown-it": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/markdown-it-link-attributes": {
|
"node_modules/markdown-it-link-attributes": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main",
|
"resolved": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main",
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
"@11ty/eleventy-navigation": "^1.0.5",
|
"@11ty/eleventy-navigation": "^1.0.5",
|
||||||
"@mdit/plugin-attrs": "^0.25.1",
|
"@mdit/plugin-attrs": "^0.25.1",
|
||||||
"luxon": "^3.7.2",
|
"luxon": "^3.7.2",
|
||||||
|
"markdown-it-anchor": "^10.0.0",
|
||||||
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
"markdown-it-link-attributes": "https://github.com/lee0c/markdown-it-link-attributes/tarball/main"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user