unlockopen / www.unlockopen.com-v4

V4 of the UnlockOpen website
0 stars 1 forks source link

Store images same folder #35

Closed madrilene closed 3 months ago

madrilene commented 3 months ago

Implementing https://github.com/unlockopen/www.unlockopen.com-v4/issues/32#issuecomment-2141958716

netlify[bot] commented 3 months ago

Deploy Preview for unlockopen-com-v4 ready!

Name Link
Latest commit 2edbd33956cef0951c7c0204c0dba99b94c01c8d
Latest deploy log https://app.netlify.com/sites/unlockopen-com-v4/deploys/665ee8a92b1e7400083a1f17
Deploy Preview https://deploy-preview-35--unlockopen-com-v4.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

tobie commented 3 months ago

What are the tradeoffs between calling the image ./blog-post-name/blog-post-name.ext vs. ./blog-post-name/lead-image.ext?

madrilene commented 3 months ago

What are the tradeoffs between calling the image ./blog-post-name/blog-post-name.ext vs. ./blog-post-name/lead-image.ext?

Our current Eleventy Image shortcode keeps the file name, which was a consideration for discoverability. If all file names are called the same, I think it would be better to change that to renaming to random strings like "i0CLMpgaIQ-440.jpeg" etc.

That apart, just personal preference I guess.

tobie commented 3 months ago

Ok, so I think we shouldn’t make a default name for the main image and just have it in the front matter. Is this a hurdle for generating the social images?

madrilene commented 3 months ago

Ok, so I think we shouldn’t make a default name for the main image and just have it in the front matter. Is this a hurdle for generating the social images?

No, not as long as I have a front matter key to reference. The square image must have the same name as the main image, and always the same string suffixed, like "-square". I can then create a filter for that and do s.th like:

{% set imagePath = article.data.image.src | appendSuffixToFilename('-square') %}

Do you want the same handling here as with the markdown images:

Path Before:

image:
  src: './src/articles/developers-apetite/abcd.jpg'

Path After:

image:
  src: './abcd.jpg'

(and as fallback):

image:
  src: '/assets/articles/developers-apetite/abcd.jpg'
tobie commented 3 months ago

Perfect!

madrilene commented 3 months ago

Have another look at that please!