articles page head
This commit is contained in:
1 parent
0661780117
commit
ed1a924156
1 file changed
+6
-10
@@ -1,26 +1,20 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import Head from 'next/head'
|
||||||
import App from '../../src/components/App'
|
import App from '../../src/components/App'
|
||||||
import ArticleCardList from '../../src/components/ArticleCardList'
|
import ArticleCardList from '../../src/components/ArticleCardList'
|
||||||
import menuModel from '../../src/models/menu'
|
import menuModel from '../../src/models/menu'
|
||||||
import { buildMenu } from '../../src/lib/menu'
|
import { buildMenu } from '../../src/lib/menu'
|
||||||
|
|
||||||
function getMeta(article) {
|
|
||||||
return {
|
|
||||||
title: article.title,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// async function renderHome(path, pageSize) {
|
|
||||||
// return render(path, Component, getMeta({ title: 'Шлиссельбургская ДХШ' }), { showAuthor: true })
|
|
||||||
// }
|
|
||||||
|
|
||||||
const Page = (props) => (
|
const Page = (props) => (
|
||||||
<App
|
<App
|
||||||
menu={buildMenu(props.pageUrl, menuModel)}
|
menu={buildMenu(props.pageUrl, menuModel)}
|
||||||
showAuthor={true}
|
showAuthor={true}
|
||||||
menuPadding={true}
|
menuPadding={true}
|
||||||
>
|
>
|
||||||
|
<Head>
|
||||||
|
<title>{props.title}</title>
|
||||||
|
</Head>
|
||||||
<div className="content content_wide">
|
<div className="content content_wide">
|
||||||
<ArticleCardList
|
<ArticleCardList
|
||||||
articles={props.articles}
|
articles={props.articles}
|
||||||
@@ -40,12 +34,14 @@ Page.getInitialProps = async (ctx) => {
|
|||||||
const articles = res.data.items
|
const articles = res.data.items
|
||||||
const nextPage = res.data.nextPage
|
const nextPage = res.data.nextPage
|
||||||
const prevPage = res.data.prevPage
|
const prevPage = res.data.prevPage
|
||||||
|
const title = 'События'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
articles,
|
articles,
|
||||||
nextPage,
|
nextPage,
|
||||||
prevPage,
|
prevPage,
|
||||||
pageUrl,
|
pageUrl,
|
||||||
|
title,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user