From 866d82f44c69bc3f170303cb76e028b29e13d645 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Fri, 2 Aug 2019 21:29:43 +0300 Subject: [PATCH] collective meta --- pages/collective.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pages/collective.jsx b/pages/collective.jsx index d56a899a..afb83518 100644 --- a/pages/collective.jsx +++ b/pages/collective.jsx @@ -2,10 +2,12 @@ import React from 'react' import axios from 'axios' import Head from 'next/head' import App from '../src/components/App' +import { Meta } from '../src/components/Meta' import CollectiveImage from '../src/components/CollectiveImage' import PersonCard from '../src/components/PersonCard' import menuModel from '../src/models/menu' import { buildMenu } from '../src/lib/menu' +import { meta } from '../src/lib/meta' const PersonCardList = ({ children }) => (
@@ -21,6 +23,7 @@ const Page = (props) => ( > {props.title} +
@@ -48,7 +51,7 @@ Page.getInitialProps = async (ctx) => { const apiUrl = `http://localhost:3000/api/persons` const res = await axios.get(apiUrl) const persons = res.data.items - + const title = 'Преподаватели Шлиссельбургской ДХШ' const imageFile = 'Images/HudozkaCollective2017.jpg' const imageUrl = `http://localhost:3000/api/image?file=${imageFile}` const resImage = await axios.get(imageUrl) @@ -57,7 +60,12 @@ Page.getInitialProps = async (ctx) => { persons, image: resImage.data.artifacts.large, pageUrl, - title: 'Коллектив', + title, + meta: meta({ + title, + url: pageUrl, + description: 'Преподаватели Шлиссельбургской ДХШ', + }) } }