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 axios from 'axios'
|
||||
import Head from 'next/head'
|
||||
import App from '../../src/components/App'
|
||||
import ArticleCardList from '../../src/components/ArticleCardList'
|
||||
import menuModel from '../../src/models/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) => (
|
||||
<App
|
||||
menu={buildMenu(props.pageUrl, menuModel)}
|
||||
showAuthor={true}
|
||||
menuPadding={true}
|
||||
>
|
||||
<Head>
|
||||
<title>{props.title}</title>
|
||||
</Head>
|
||||
<div className="content content_wide">
|
||||
<ArticleCardList
|
||||
articles={props.articles}
|
||||
@@ -40,12 +34,14 @@ Page.getInitialProps = async (ctx) => {
|
||||
const articles = res.data.items
|
||||
const nextPage = res.data.nextPage
|
||||
const prevPage = res.data.prevPage
|
||||
const title = 'События'
|
||||
|
||||
return {
|
||||
articles,
|
||||
nextPage,
|
||||
prevPage,
|
||||
pageUrl,
|
||||
title,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user