next config refactoring

This commit is contained in:
tmshv committed 2019-08-02 16:08:13 +03:00
1 parent 4378d49681
commit 07cd42abc1
1 file changed
+5 -4
+5 -4
View File
@@ -27,8 +27,9 @@ module.exports = withCss(withSass({
return null return null
} }
const lastArticlesPage = 8 const articlesPageSize = 15
const articlesLastPage = 8
return { return {
// ...defaultPathMap, // ...defaultPathMap,
'/': { page: '/' }, '/': { page: '/' },
@@ -40,8 +41,8 @@ module.exports = withCss(withSass({
...createPath( ...createPath(
'/articles/[page]', '/articles/[page]',
x => x.replace('/articles/', ''), x => x.replace('/articles/', ''),
page => ({ page, pageSize: 15 }), page => ({ page, pageSize: articlesPageSize }),
range(1, lastArticlesPage + 1).map(x => `/articles/${x}`), range(1, articlesLastPage + 1).map(x => `/articles/${x}`),
), ),
...createPath( ...createPath(
'/next', '/next',