From 3fb170dda610ac79ef411e8dec593419a6c707cb Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Tue, 18 Aug 2020 15:39:25 +0300 Subject: Fix loading the JavaScript of the clarity theme --- website/themes/hugo-clarity/assets/js/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/website/themes/hugo-clarity/assets/js/index.js b/website/themes/hugo-clarity/assets/js/index.js index 16e12f8..b2e8152 100644 --- a/website/themes/hugo-clarity/assets/js/index.js +++ b/website/themes/hugo-clarity/assets/js/index.js @@ -235,10 +235,12 @@ function fileClosure(){ const modifiers = [':left', ':right']; const altArr = alt.split('::').map(x => x.trim()) - altArr[1]?.split(' ').filter(Boolean).forEach(cls =>{ - pushClass(image, cls); - alt = altArr[0] - }) + if (altArr[1] !== undefined) { + altArr[1].split(' ').filter(Boolean).forEach((cls) =>{ + pushClass(image, cls); + alt = altArr[0] + }) + } modifiers.forEach(function(modifier){ const canModify = alt.includes(modifier); -- cgit v1.3.1-23-gd82d