From 4ee2ec7d748f93b95514ef70a28aa1410b742da8 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sat, 3 Aug 2019 00:26:40 +0300 Subject: [PATCH] article page meta --- pages/article/[article].jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pages/article/[article].jsx b/pages/article/[article].jsx index cfe43688..5ef4cae6 100644 --- a/pages/article/[article].jsx +++ b/pages/article/[article].jsx @@ -6,6 +6,8 @@ import Article from '../../src/components/Article' import Html from '../../src/components/Html' import menuModel from '../../src/models/menu' import { buildMenu } from '../../src/lib/menu' +import { Meta } from '../../src/components/Meta' +import { meta } from '../../src/lib/meta' const Page = (props) => ( ( > {props.article.title} +
{ const apiUrl = `http://localhost:3000/api/articles/${id}` const res = await axios.get(apiUrl) const article = res.data + const image = article.preview.artifacts.fb return { article, pageUrl, + meta: meta({ + title: article.title, + image: image.src, + imageWidth: image.width, + imageHeight: image.height, + }), } }