-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image updates #244
Image updates #244
Conversation
- Added file extension `jpeg` to widen the image capture net 😃 - Added notes to README
src/_11ty/shortcodes/ArticleCard.js
Outdated
@@ -7,7 +7,7 @@ const truncate = require(`${filtersDir}/truncate.js`); | |||
module.exports = ({ data = {}, templateContent, url } = {}, { label } = {}) => { | |||
const { author = '', date, image, title = '', locale = '' } = data; | |||
const imageSrc = image | |||
? image | |||
? `${url}images/${image}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pete-Robelou I wonder whether here (and inblog-post
) we just concat ${url}${image}
, which is perhaps a more intuitive outcome for those filling out image:
i.e. using the path to wherever their image is relative to the blog post itself?
I.e. We're proposing the convention is always to put blog images in an images
directory (which thankfully the WP export has followed suit), but does it give us more predictability/flexibility, should someone not follow our advice in the README? I.e. And just puts a single image alongside the index.md
? Should that be fair game?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's fair. I'll remove our enforced /images
.
@@ -2,9 +2,10 @@ | |||
title: "v14.2.22 Nautilus released" | |||
date: "2021-06-30" | |||
author: "dgalloway" | |||
image: image.jpeg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to remove this test data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot 🙂
I'm wondering whether we might want to roll this this same convention into Case studies (at the moment they're referencing assets from the global What do you think, @Pete-Robelou? |
Yeah, that's an interesting one. Company logos definitely work better from a centralised location, this also prevents any duplication if they were all co-located. It does unfortunately introduce a mix in the front matter though if we co-locate regular assets and centralise logos. If we document it in the README maybe that's good enough?
|
Yep, I think so. If we specify that By extension, I can envisage a future solution that might check if the path startsWith |
Maybe. That definitely feels like a |
Yeah, suggesting that as a fairly established convention (e.g. hyperlinks would follow that convention), so hopefully feels intuitive even for those who skip the README |
That's fair. Do you want to propose it as an update or shall we wait until it becomes more of a requirement? |
Let's action separate to this update. Sorry, mentioned here as it triggered the thought, but actually a bigger fish to fry, I'd say. |
Co-authored-by: Adam Duncan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Pete-Robelou
jpeg
to widen the image capture net 🙂I set the number of colours to
96
for gifsicle, this offers a reasonable level of compression without degrading the image too much. Our mileage will vary a bit though depending on the image, ideally we need to encourage the use ofjpg
for photography andpng
for everything else.Closes #243