From 37fb8d59778d6883fb43ac59bc352ac3001118e2 Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Sat, 22 Feb 2020 20:32:18 -0800 Subject: [PATCH] Fix _ images being recorded wrong in metadata --- gulp/content/files.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gulp/content/files.js b/gulp/content/files.js index e5c9b23..d066ce0 100644 --- a/gulp/content/files.js +++ b/gulp/content/files.js @@ -37,10 +37,6 @@ module.exports = exports = function () { dimensions.orientation = 'wide'; } - if (basename[0] === '_') { - basename = basename.slice(1); - } - const filetype = { '.jpeg': 'jpeg', '.jpg': 'jpeg', @@ -48,6 +44,21 @@ module.exports = exports = function () { '.gif': 'gif', }[ext]; + if (basename[0] === '_') { + basename = basename.slice(1); + return { + name: basename, + type: 'image', + sizes: [ + { + url: path.join(siteDir, `${basename}${ext}`), + width: dimensions.width, + height: dimensions.height, + }, + ], + }; + } + const sizes = [ { url: path.join(siteDir, `${basename}.${filetype}`),