ArticleGrid img
This commit is contained in:
1 parent
b96e06068e
commit
f08d577e11
2 files changed
+3
-3
No files matched your search
@@ -5,6 +5,7 @@ module.exports = withCss(withSass({
|
|||||||
exportTrailingSlash: true,
|
exportTrailingSlash: true,
|
||||||
env: {
|
env: {
|
||||||
APP_ARTICLES_PAGE_SIZE: 24,
|
APP_ARTICLES_PAGE_SIZE: 24,
|
||||||
|
APP_CARD_DEFAULT_IMAGE: 'https://art.shlisselburg.org/static/img/HudozkaMain2014.jpg',
|
||||||
},
|
},
|
||||||
webpack(config) {
|
webpack(config) {
|
||||||
config.resolve.modules.push(__dirname)
|
config.resolve.modules.push(__dirname)
|
||||||
|
|||||||
@@ -12,13 +12,12 @@ export interface IResizeImage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function resizeImage(src: string, options: IResizeImage): string {
|
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) {
|
function getImage(image?: ImageDefinition) {
|
||||||
if (!image) {
|
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 src = resizeImage(defaultSrc, { w: 400, h: 400 })
|
||||||
const set = [
|
const set = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user