Tidy up logging
Looks like we'll need some disk-based cache, as it's still making multiple requestspull/1/head
parent
90c7a470a7
commit
5a549e67a9
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue