-
Notifications
You must be signed in to change notification settings - Fork 0
/
headless.config.js
63 lines (59 loc) · 1.38 KB
/
headless.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* UHeadless Config
*
* @type {import('@headstartwp/core').HeadlessConfig}
*/
module.exports = {
/**
* The WordPress Source Url
*/
sourceUrl: process.env.NEXT_PUBLIC_HEADLESS_WP_URL,
hostUrl: process.env.HOST_URL,
/**
* Register works cpt and its custom taxonomy
*/
customPostTypes: [
{
slug: "work",
endpoint: "/wp-json/wp/v2/work",
single: "/work",
archive: "/works",
},
],
customTaxonomies: [
{
slug: "work-category",
endpoint: "/wp-json/wp/v2/work-category",
postType: ["work"],
rewrite: "work-category",
restParam: "work-category",
},
{
slug: "tech-stack",
endpoint: "/wp-json/wp/v2/tech-stack",
postType: ["work"],
rewrite: "tech-stack",
restParam: "tech-stack",
},
{
slug: "work-organization",
endpoint: "/wp-json/wp/v2/work-organization",
postType: ["work"],
rewrite: "work-organization",
restParam: "work-organization",
},
],
redirectStrategy: "404",
/**
* Using 10up's headless plugin is recommended
*/
useWordPressPlugin: true,
debug: {
requests: process.env?.ENABLE_REQUEST_DEBUG === "true",
redirects: process.env?.ENABLE_REDIRECT_DEBUG === "true",
/**
* devMode logs additional stuff that can be helpful for debugging
*/
devMode: process.env?.ENABLE_DEV_MODE === "true",
},
};