nhoizey’s avatarnhoizey’s Twitter Archive—№ 104,496

  1. …in reply to @BryceWrayTX
    @BryceWrayTX You can put your images wherever you want! I have yet to add details to the documentation for different use cases. For my own site, each article as it’s own folder, with the Markdown and image(s): github.com/nhoizey/nicolas-hoizey.com/tree/master/src/articles/2020/01/10/can-we-monitor-user-happiness-on-the-web-with-performance-tools …/…
    1. …in reply to @nhoizey
      @BryceWrayTX I use the same folder hierarchy in the source as in the site, so I don’t have any permalink to compute for HTML files. I added image extensions to templateFormats so that Eleventy copy them for me in the same hierarchy: github.com/nhoizey/nicolas-hoizey.com/blob/a25262c221ff8f19e129352fd67df89092514a1d/.eleventy.js#L290 …/…
      1. …in reply to @nhoizey
        @BryceWrayTX Where I call the plugin: github.com/nhoizey/nicolas-hoizey.com/blob/a25262c221ff8f19e129352fd67df89092514a1d/.eleventy.js#L261-L263 I use these options: github.com/nhoizey/nicolas-hoizey.com/blob/a25262c221ff8f19e129352fd67df89092514a1d/src/_data/images-responsiver-config.js#L6-L42 The runBefore hook finds images in the page HTML, computes the image dimension for width/height attributes and the full URL. …/…
        1. …in reply to @nhoizey
          @BryceWrayTX The plugin then transforms the URL as I told it: github.com/nhoizey/nicolas-hoizey.com/blob/a25262c221ff8f19e129352fd67df89092514a1d/src/_data/images-responsiver-config.js#L6-L42 Here, I’m using @cloudinary to resize (and optimize) images, so I don’t have to compute any image on my local build.
    2. …in reply to @nhoizey