const UpgradeHelper = require("@11ty/eleventy-upgrade-help"); const markdownIt = require("markdown-it"); module.exports = function(eleventyConfig) { eleventyConfig.addPlugin(UpgradeHelper); // Copying static assets eleventyConfig.addPassthroughCopy("src/style.css"); eleventyConfig.addPassthroughCopy("src/photo.png"); eleventyConfig.addPassthroughCopy("src/advent_pro_500.woff2"); eleventyConfig.addPassthroughCopy("src/advent_pro_600.woff2"); eleventyConfig.addPassthroughCopy("src/updock_400.woff2"); eleventyConfig.addPassthroughCopy("src/LMRoman10-Bold.woff2"); eleventyConfig.addPassthroughCopy("src/LMRoman10-Regular.woff2"); // Configuring permalinks to be ~.html instead of ~/ eleventyConfig.addGlobalData("permalink", () => { return (data) => `${data.page.filePathStem}.${data.page.outputFileExtension}`; }); eleventyConfig.addFilter("formatDate", (dateString) => { if (!dateString) return "Present"; const date = new Date(dateString); return date.toLocaleDateString('en-US', { year: 'numeric', month: 'short' }); }); eleventyConfig.addFilter("markdown", (str) => markdownIt().render(str)); // Options return { dir: { input: "src", output: "dist" } } };