Skip to content

Commit

Permalink
parse pages
Browse files Browse the repository at this point in the history
  • Loading branch information
aloxe committed Nov 28, 2024
1 parent 27c2c45 commit 7c2a33c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require("fs");
const path = require("path");
const pageAssetsPlugin = require('eleventy-plugin-page-assets');
const htmlmin = require("html-minifier-terser");
const tailwind = require('tailwindcss');
const postCss = require('postcss');
Expand Down Expand Up @@ -139,6 +140,16 @@ module.exports = async function(eleventyConfig) {
return Image.generateHTML(imageMetadata, imageAttributes)
});


// COPY IMAGES LINKED in PAGES
// this is not regexp but Glob patern (picomatch https://npm.devtool.tech/picomatch)
eleventyConfig.addPlugin(pageAssetsPlugin, {
mode: "parse",
postsMatching: "src/pages/*.{md,html}",
recursive: false,
hashAssets: false,
});

return {
dir: {
input: "src/pages",
Expand All @@ -150,7 +161,7 @@ module.exports = async function(eleventyConfig) {
templateFormats: ['md', 'njk', 'jpg', 'gif', 'png', 'html'],
pathPrefix: process.env.BASE_HREF ? `/${process.env.BASE_HREF}/` : "/" // used with github pages
}
};
}; // end config

function htmlminTransform(content, outputPath) {
if( outputPath.endsWith(".html") ) {
Expand Down

0 comments on commit 7c2a33c

Please sign in to comment.