From 5a549e67a9e364d2ce4e87c3bfac48ca7950fcc1 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 17 Oct 2021 14:52:25 +0100 Subject: [PATCH] Tidy up logging Looks like we'll need some disk-based cache, as it's still making multiple requests --- src/.eleventy.js | 3 --- src/index.11tydata.js | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/.eleventy.js b/src/.eleventy.js index 8cd7a75..39305e8 100644 --- a/src/.eleventy.js +++ b/src/.eleventy.js @@ -18,14 +18,12 @@ function hash(str) { } async function filter_asset(src) { - process.stdout.write(`ASSET ${src} `); let target_dir = `../_site/img`; if(!fs.existsSync(target_dir)) await fs.promises.mkdir(target_dir, { recursive: true }); let filename = path.basename(src); if(src.search(/^https?:(?:\/\/)?/) > -1) { - console.log(`URL`); let content = await fetch(src, "none"); // Determine the file type extension @@ -47,7 +45,6 @@ async function filter_asset(src) { ); } else { - console.log(`LOCAL`); // Generally speaking we optimise PNGs *very* well with oxipng/Zopfli, // and the Image plugin doesn't respect this await fs.promises.copyFile(src, path.join(target_dir, filename)); diff --git a/src/index.11tydata.js b/src/index.11tydata.js index 77af64c..1ee62ab 100644 --- a/src/index.11tydata.js +++ b/src/index.11tydata.js @@ -73,7 +73,8 @@ async function do_feeds() { item.media_image = temp_image[1]; } item.media_image_notfound = item.media_image == `./images/post.svg`; - console.log(`MEDIA IMAGE`, item.media_image); + if(!item.media_image_notfound) + console.log(`MEDIA IMAGE`, item.media_image); if(typeof process.env["DEBUG_FEEDITEMS"] != "undefined") console.log(`FEED ITEM`, item);