forked from ciampo/offbeat-appetite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes-config.js
46 lines (44 loc) · 977 Bytes
/
routes-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* eslint-disable @typescript-eslint/no-var-requires */
const {
pageHomeType,
pageAboutType,
pageThankYouType,
pageBlogPostType,
pageCategoryType,
pageSearchType,
} = require('./sanity/pages.js');
const { categoryType } = require('./sanity/category');
const { blogPostType } = require('./sanity/blogPost');
module.exports = [
{
route: '/',
dataType: pageHomeType,
},
{
route: '/about',
dataType: pageAboutType,
},
{
route: '/search',
dataType: pageSearchType,
},
{
route: '/[categoryId]',
dataType: pageCategoryType,
dynamicDataType: categoryType,
generateParams: (catItem) => ({ categoryId: catItem.slug }),
},
{
route: '/[categoryId]/[postId]',
dataType: pageBlogPostType,
dynamicDataType: blogPostType,
generateParams: (postItem) => ({
categoryId: postItem.category.slug,
postId: postItem.slug,
}),
},
{
route: '/thanks',
dataType: pageThankYouType,
},
];