diff --git a/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241 b/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241 new file mode 100644 index 00000000..d7c61365 --- /dev/null +++ b/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241 @@ -0,0 +1 @@ +[{"771e2ee768352bc06ce998c0240241":"1"},{"cachedAt":1690466873438,"type":"2"},"buffer"] \ No newline at end of file diff --git a/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241.buffer b/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241.buffer new file mode 100644 index 00000000..abae8c2a Binary files /dev/null and b/.cache/eleventy-fetch-771e2ee768352bc06ce998c0240241.buffer differ diff --git a/.eleventy.js b/.eleventy.js index 817ebf74..ef91dab7 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -7,6 +7,18 @@ const markdownItAnchor = require("markdown-it-anchor"); const packageVersion = require("./package.json").version; const fs = require("fs"); const eleventyNavigationPlugin = require("@11ty/eleventy-navigation"); +const Image = require("@11ty/eleventy-img"); + +(async () => { + let url = "https://images.unsplash.com/photo-1608178398319-48f814d0750c"; + let stats = await Image(url, { + widths: ["auto"], + urlPath: "./src/img/", + outputDir: "./docs/img/" + }); + + console.log( stats ); +})(); module.exports = function (eleventyConfig) { eleventyConfig.addPlugin(syntaxHighlight); @@ -28,6 +40,23 @@ module.exports = function (eleventyConfig) { eleventyConfig.addShortcode("year", () => `${new Date().getFullYear()}`); eleventyConfig.addShortcode("packageVersion", () => `v${packageVersion}`); + eleventyConfig.addShortcode("image", async function(src, alt, sizes) { + let metadata = await Image(src, { + widths: ["auto"], + urlPath: "./src/img/", + outputDir: "./docs/img/" + }); + + let imageAttributes = { + alt, + sizes, + loading: "lazy", + decoding: "async", + }; + + return Image.generateHTML(metadata, imageAttributes); + }); + eleventyConfig.setBrowserSyncConfig({ callbacks: { ready: function(err, bs) { @@ -63,19 +92,13 @@ module.exports = function (eleventyConfig) { /* Markdown Overrides */ let markdownLibrary = markdownIt({ html: true, - }).use(markdownItAnchor, { - permalink: true, - permalinkClass: "tdbc-anchor", - permalinkSymbol: "#", - permalinkSpace: false, - level: [1, 2, 3], - slugify: (s) => - s - .trim() - .toLowerCase() - .replace(/[\s+~\/]/g, "-") - .replace(/[().`,%·'"!?¿:@*]/g, ""), - }); + breaks: true, + langPrefix: 'language-', + linkify: true, + }) + .use(markdownItAnchor, { + permalink: markdownItAnchor.permalink.headerLink({ safariReaderFix: true }) + }) eleventyConfig.setLibrary("md", markdownLibrary); return { diff --git a/.vscode/settings.json b/.vscode/settings.json index bc307c96..4f88b641 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,16 @@ "cSpell.ignoreWords": [ "borderless", "customerengagement" + ], + "cSpell.words": [ + "cssnano", + "keybase", + "linkify", + "luxon", + "postbuild", + "Shortcode", + "stylelint", + "syntaxhighlight", + "webfonts" ] -} \ No newline at end of file +} diff --git a/docs/about/index.html b/docs/about/index.html index 61334a68..dc5d9d99 100644 --- a/docs/about/index.html +++ b/docs/about/index.html @@ -8,7 +8,7 @@