Skip to content

Commit 4f92d3d

Browse files
committed
Хот-фикс: чинит картинки на главной
1 parent 682fa2a commit 4f92d3d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/includes/blocks/featured-article.njk

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{% macro featuredArticle(article, class, isLazyLoading=false) %}
2-
{% set hasImage = article.cover %}
3-
42
<article class="featured-article {{ class if class }}" style="--accent-color: var(--color-{{ article.section }})">
5-
{% if hasImage %}
3+
{% if article.imageLink %}
64
<picture class="featured-article__image-wrapper">
75
<img
86
class="featured-article__image"

src/scripts/modules/transform-article-data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = function transformArticleData(article) {
55
title: article.data.title,
66
cover: article.data.cover ?? {},
77
get imageLink() {
8-
return `${this.cover.mobile}`
8+
return Object.keys(this.cover).includes('mobile') ? `${this.cover.mobile}` : undefined
99
},
1010
description: article.data.description,
1111
link: `/${section}/${article.fileSlug}/`,

0 commit comments

Comments
 (0)