Skip to content
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

Fallback for 404ing blog post thumbnails #605

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

rebeccacremona
Copy link
Contributor

In this design, the list of blog posts is a series of labeled images. The logic is supposed to be as follows:

  • if a post defines a special thumbnail, use that
  • if not, and if a post contains one or more images, use the first image in the post
  • if not, use one of the fallback images

This PR fixes that: as is, the special thumbnail is overridden by a first image.

And, it adds special handling for when the first image 404s using this strategy, which I hadn't seen before.

I note you have to do this in two spots: the HTML include used by Jekyll.... and the javascript file used to render search results.

Before:
image

After:
image

@rebeccacremona rebeccacremona merged commit e810d0e into harvard-lil:redesign Sep 18, 2024
1 check passed
@rebeccacremona rebeccacremona deleted the post-images branch September 18, 2024 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant