generated from inherentlee/11ty
ok big chunk o' everything
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { attrs } from "@mdit/plugin-attrs";
|
||||
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
|
||||
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
|
||||
import { markdownitLinkAttributes } from 'markdown-it-link-attributes';
|
||||
import path from "node:path";
|
||||
|
||||
import pluginFilters from "./_config/filters.js";
|
||||
@@ -8,6 +10,18 @@ export default async function (eleventyConfig) {
|
||||
/* Markdown HTML attribute parsing */
|
||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(attrs));
|
||||
|
||||
/* Markdown apply target="_blank" to all external links */
|
||||
const milaOptions = {
|
||||
matcher(href) {
|
||||
return href.match(/^https?:\/\//);
|
||||
},
|
||||
attrs: {
|
||||
target: "_blank",
|
||||
rel: "external",
|
||||
},
|
||||
};
|
||||
eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(markdownitLinkAttributes, milaOptions));
|
||||
|
||||
/* Bundles */
|
||||
/* CSS */
|
||||
eleventyConfig.addBundle("css", {
|
||||
@@ -49,6 +63,8 @@ export default async function (eleventyConfig) {
|
||||
},
|
||||
});
|
||||
|
||||
eleventyConfig.addPlugin(eleventyNavigationPlugin);
|
||||
|
||||
/* All filters from _config/filters.js */
|
||||
eleventyConfig.addPlugin(pluginFilters);
|
||||
|
||||
@@ -59,6 +75,7 @@ export default async function (eleventyConfig) {
|
||||
|
||||
/* Watch when serving */
|
||||
eleventyConfig.addWatchTarget("css");
|
||||
eleventyConfig.addWatchTarget("js");
|
||||
}
|
||||
|
||||
export const config = {
|
||||
|
||||
Reference in New Issue
Block a user