From f08d577e11698123e7e9a457ae0405b02709557e Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Thu, 27 Feb 2020 17:12:15 +0300 Subject: [PATCH] ArticleGrid img --- next.config.js | 1 + src/components/ArticleGrid/index.tsx | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/next.config.js b/next.config.js index 87b1671d..b3ccf681 100644 --- a/next.config.js +++ b/next.config.js @@ -5,6 +5,7 @@ module.exports = withCss(withSass({ exportTrailingSlash: true, env: { APP_ARTICLES_PAGE_SIZE: 24, + APP_CARD_DEFAULT_IMAGE: 'https://art.shlisselburg.org/static/img/HudozkaMain2014.jpg', }, webpack(config) { config.resolve.modules.push(__dirname) diff --git a/src/components/ArticleGrid/index.tsx b/src/components/ArticleGrid/index.tsx index e62aa802..3d345adc 100644 --- a/src/components/ArticleGrid/index.tsx +++ b/src/components/ArticleGrid/index.tsx @@ -12,13 +12,12 @@ export interface IResizeImage { } export function resizeImage(src: string, options: IResizeImage): string { - return src - // return `https://images.weserv.nl/?url=${src}&w=${options.w}&h=${options.h}&n=-1` + return `https://images.weserv.nl/?url=${src}&w=${options.w}&h=${options.h}&n=-1` } function getImage(image?: ImageDefinition) { if (!image) { - const defaultSrc = '/static/img/HudozkaMain2014.jpg' + const defaultSrc = process.env.APP_CARD_DEFAULT_IMAGE const src = resizeImage(defaultSrc, { w: 400, h: 400 }) const set = [ {