Skip to content
Discussion options

You must be logged in to vote

I'm not seeing the same behavior locally with my presumably similar config:

.eleventy.js

/**
 * @typedef {import('@11ty/eleventy/src/UserConfig')} EleventyConfig
 * @typedef {ReturnType<import('@11ty/eleventy/src/defaultConfig')>} EleventyReturnValue
 * @type {(eleventyConfig: EleventyConfig) => EleventyReturnValue}
 */
module.exports = function (eleventyConfig) {
  eleventyConfig.addNunjucksAsyncShortcode("productImage", async (src="", alt="") => {
    return Promise.resolve(`<img src="${src}" alt="${alt}" loading="lazy" />`);
  });

  return {
    dir: {
      input: "src",
      output: "www",
    }
  };
};

src/index.njk

---
title: Index
layout: layout.njk
---

<h1>{{ title }}</h1>

src…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@gasatrya
Comment options

Comment options

You must be logged in to vote
4 replies
@gasatrya
Comment options

@gasatrya
Comment options

@pdehaan
Comment options

pdehaan Nov 4, 2022
Collaborator

@pdehaan
Comment options

pdehaan Nov 4, 2022
Collaborator

Comment options

You must be logged in to vote
1 reply
@gasatrya
Comment options

Answer selected by gasatrya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants