diff --git a/.eleventy.js b/.eleventy.js index 7bb286d..9369d08 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -39,5 +39,11 @@ module.exports = function (eleventyConfig) { }, }) + // Convert img filename to alt text + eleventyConfig.addFilter('toAlt', (text) => { + const basename = text.split('.') + return basename[0].replace(/_/g, ' ') + }) + return {dir: {input: 'src', output: 'dist'}} } diff --git a/src/collections/buttons.liquid b/src/collections/buttons.liquid index fa44380..1cebe9a 100644 --- a/src/collections/buttons.liquid +++ b/src/collections/buttons.liquid @@ -5,7 +5,10 @@ layout: layout.liquid {% for source in buttons %} {% for button in source[1] %} - {{ source[0] }} + {{ button | toAlt }} {% endfor %} {% endfor %} diff --git a/src/collections/collections.11tydata.js b/src/collections/collections.11tydata.js index 2e06f92..099fec8 100644 --- a/src/collections/collections.11tydata.js +++ b/src/collections/collections.11tydata.js @@ -68,6 +68,6 @@ module.exports = async function () { } collections.credits = credits - console.log(collections.buttons) + return collections } diff --git a/src/collections/images/buttons/GIFCollection/2019.gif b/src/collections/images/buttons/GIFCollection/Still using buttons in 2019.gif similarity index 100% rename from src/collections/images/buttons/GIFCollection/2019.gif rename to src/collections/images/buttons/GIFCollection/Still using buttons in 2019.gif