[www] articles router eslinted

This commit is contained in:
Roman Timashev committed 2017-09-19 13:46:35 +03:00
1 parent 6eb35930ea
commit 4d3fa1c064
1 file changed
+20 -20
+20 -20
View File
@@ -90,29 +90,29 @@ async function getArticleListComponent(path, page, pageSize) {
} }
function getMeta(article) { function getMeta(article) {
const types = [ const types = [
ImageArtifactType.FACEBOOK, ImageArtifactType.FACEBOOK,
ImageArtifactType.MEDIUM, ImageArtifactType.MEDIUM,
ImageArtifactType.BIG, ImageArtifactType.BIG,
ImageArtifactType.ORIGIN, ImageArtifactType.ORIGIN,
] ]
const meta = { const meta = {
title: article.title, title: article.title,
} }
if (article.preview) { if (article.preview) {
try { try {
const artifact = article.preview.findArtifact(types) const artifact = article.preview.findArtifact(types)
meta.image = artifact.url meta.image = artifact.url
meta.imageWidth = artifact.width meta.imageWidth = artifact.width
meta.imageHeight = artifact.height meta.imageHeight = artifact.height
} catch (error) { } catch (error) {
meta.image = 'https://art.shlisselburg.org/entrance.jpg' meta.image = 'https://art.shlisselburg.org/entrance.jpg'
meta.imageWidth = 1200 meta.imageWidth = 1200
meta.imageHeight = 630 meta.imageHeight = 630
} }
} }
return meta return meta
} }
function getArticles(pageSize) { function getArticles(pageSize) {