Skip to content

Commit 3a88abc

Browse files
committed
Resolve avatar update issues; tweak others
1 parent 7db895e commit 3a88abc

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

.eleventy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = (eleventyConfig) => {
8484
eleventyConfig.addPlugin(pluginRss);
8585

8686
// FILTER: Atom date format
87-
eleventyConfig.addLiquidFilter("dateToRfc3339", pluginRss.dateToRfc3339);
87+
eleventyConfig.addLiquidFilter('dateToRfc3339', pluginRss.dateToRfc3339);
8888

8989
// TRANSFORM: minify HTML
9090
eleventyConfig.addTransform('htmlmin', (content, outputPath) => {

_includes/filter.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ module.exports = {
77
*
88
* @returns {string} Slugified date.
99
*/
10-
dateSlug: (pageDate) => {
11-
return pageDate.toISOString().slice(0, 10).replace(/-/g, '/');
12-
},
10+
dateSlug: (pageDate) => pageDate.toISOString().slice(0, 10).replace(/-/g, '/'),
1311

1412
/**
1513
* Reverse array without mutating the original.
@@ -63,7 +61,5 @@ module.exports = {
6361
return content.replace(re, replacement);
6462
},
6563

66-
UTCString: (date) => {
67-
return date.toUTCString();
68-
},
64+
UTCString: (date) => date.toUTCString(),
6965
};

_includes/shortcodes/avatar.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
88
const classAttr = className ? `class="${className}"` : '';
99

1010
try {
11-
const stats = await Image(src, {
11+
let metadata = await Image(src, {
1212
cacheOptions: {
1313
// renew img cache every 12 weeks
1414
duration: '12w',
15-
// version control the img cache so GitHub Pages doesn't start from scratch
15+
// add img cache to version control so GitHub Pages doesn't lose people pics
16+
// from old links (e.g., twitter) that have long since expired
1617
directory: '_cache',
1718
},
1819
formats: [outputFormat],
@@ -21,14 +22,14 @@ module.exports = async (src, alt, className, outputFormat = 'jpeg') => {
2122
widths: [96],
2223
});
2324

24-
const props = stats[outputFormat].pop();
25+
let data = metadata.jpeg[metadata.jpeg.length - 1];
2526

26-
return `<img ${classAttr} src="${props?.url}" alt="${alt}" loading="lazy">`;
27+
return `<img ${classAttr} src="${data.url}" alt="${alt}" loading="lazy" decoding="async">`;
2728
} catch (err) {
2829
// eslint-disable-next-line no-console
29-
console.error('Avatar: eleventy-img error:', err);
30+
console.error('Avatar: eleventy-img:', err);
3031

3132
// load empty img src (as placeholder)
32-
return `<img ${classAttr} src="" alt="${alt}" loading="lazy">`;
33+
return `<img ${classAttr} src="" alt="${alt}">`;
3334
}
3435
};

_sass/_main.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ $footer-background-color: $white-ter;
149149
white-space: nowrap !important;
150150
width: 0.01em !important;
151151
}
152+
153+
// revert to Bulma 0.9.0 padding
154+
.section {
155+
padding-inline: 1.5rem;
156+
}
152157
}
153158

154159
.has-text-tetradic1 {

0 commit comments

Comments
 (0)