From 4d3fa1c064fe012d3efb305ee19d5c6691f898c1 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Tue, 19 Sep 2017 13:46:35 +0300 Subject: [PATCH] [www] articles router eslinted --- src/routes/articles.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/routes/articles.js b/src/routes/articles.js index f579ff89..651c9712 100644 --- a/src/routes/articles.js +++ b/src/routes/articles.js @@ -90,29 +90,29 @@ async function getArticleListComponent(path, page, pageSize) { } function getMeta(article) { - const types = [ - ImageArtifactType.FACEBOOK, - ImageArtifactType.MEDIUM, - ImageArtifactType.BIG, - ImageArtifactType.ORIGIN, - ] - const meta = { + const types = [ + ImageArtifactType.FACEBOOK, + ImageArtifactType.MEDIUM, + ImageArtifactType.BIG, + ImageArtifactType.ORIGIN, + ] + const meta = { title: article.title, } - if (article.preview) { - try { - const artifact = article.preview.findArtifact(types) - meta.image = artifact.url - meta.imageWidth = artifact.width - meta.imageHeight = artifact.height - } catch (error) { - meta.image = 'https://art.shlisselburg.org/entrance.jpg' - meta.imageWidth = 1200 - meta.imageHeight = 630 - } - } - return meta + if (article.preview) { + try { + const artifact = article.preview.findArtifact(types) + meta.image = artifact.url + meta.imageWidth = artifact.width + meta.imageHeight = artifact.height + } catch (error) { + meta.image = 'https://art.shlisselburg.org/entrance.jpg' + meta.imageWidth = 1200 + meta.imageHeight = 630 + } + } + return meta } function getArticles(pageSize) {