From 6692d06e5fa3ec774ed31d833d00dcef03b58f8e Mon Sep 17 00:00:00 2001 From: Jessica Lawshe Date: Thu, 4 Oct 2018 11:24:01 +0100 Subject: [PATCH] Handle image_src in metadata layout The CMS is already using `image`, which is an object based on data from the API. --- services/web/app/views/_metadata.pug | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/web/app/views/_metadata.pug b/services/web/app/views/_metadata.pug index 4857162a9e..253757b6a8 100644 --- a/services/web/app/views/_metadata.pug +++ b/services/web/app/views/_metadata.pug @@ -25,10 +25,16 @@ //- Image -if (metadata && metadata.image) + //- from the CMS meta(itemprop="image", name="image", content=metadata.image.fields.file.url) +-else if (metadata && metadata.image_src) + //- pages with custom metadata images, metadata.image_src is the full image URL + meta(itemprop="image", name="image", content=metadata.image_src) -else if (settings.overleaf) + //- the default image for Overleaf meta(itemprop="image", name="image", content=buildImgPath('ol-brand/overleaf_og_logo.png')) -else + //- the default image for ShareLaTeX meta(itemprop="image", name="image", content='/touch-icon-192x192.png') //- Keywords