Skip to content

Commit

Permalink
fix article image logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlalchand committed Jul 11, 2024
1 parent ae20c5a commit 57c9cea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/reporting.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { fetchImage } from "../utils/fetchImage";
// Fetch images for articles during build
const articlesWithImages = await Promise.all(
articles.map(async (article) => {
const imageUrl = article.image || (await fetchImage(article.link));
const imageUrl =
(await fetchImage(article.link)) ||
"/photography-compressed/" + article.image;
return {
...article,
image: imageUrl,
Expand Down

0 comments on commit 57c9cea

Please sign in to comment.