You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/01-Getting Started/headless-config.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ module.exports = {
45
45
46
46
## Splitting client/server config
47
47
48
-
You can split the config between a client and a server config. This is needed when you're setting up [cache handler](/learn/data-fetching/caching/).
48
+
You can split the config between a client and a server config. This is needed when you're setting up [cache handler](/learn/pages-router/data-fetching/caching/).
49
49
50
50
Simply create a `headstartwp.config.client.js` and a `headstartwp.config.server.js` file and HeadstartWP will pick them up and inject on the appropriate bundle.
51
51
@@ -196,9 +196,6 @@ This route would automatically handle the following URLs:
196
196
- /books/genre/genre-name -> filter books by genre
197
197
- /books/genre/genre-name/page/2 -> paginate books filtered by genre
198
198
199
-
:::caution
200
-
The code snippet above does not implement pre-fetching, which you probably want to. Check out the [pre-fetching docs](/learn/data-fetching/prefetching-data-server) for instructions.
201
-
:::
202
199
203
200
It is also possible to specify a function for 'customTaxonomies', when doing so the default taxonomies will be passed to the function. This can be used for instance to enable archive path matching.
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ module.exports = {
45
45
46
46
## Splitting client/server config
47
47
48
-
You can split the config between a client and a server config. This is needed when you're setting up [cache handler](/learn/data-fetching/caching/).
48
+
You can split the config between a client and a server config. This is needed when you're setting up [cache handler](/learn/pages-router/data-fetching/caching/).
49
49
50
50
Simply create a `headstartwp.config.client.js` and a `headstartwp.config.server.js` file and HeadstartWP will pick them up and inject on the appropriate bundle.
The `single` option is required for several things including:
98
98
- properly previewing custom post types when the "single" route is at a different prefix. E.g: `/book/da-vince-code` instead of `/da-vice-code`; In this case, the framework will use the `single` path to redirect the previewed post to the right path/route.
99
-
- Matching post path permalinks with the current URL. E.g: when fetching a single custom post type the framework will filter the returned posts to the one that matches the existing URL. Therefore, the framework needs to know the single prefix url for custom post types. This is required to properly handle parent pages that share the same child slug. See [post path mapping](/learn/data-fetching/usepost/#post-path-matching) for more info.
99
+
- Matching post path permalinks with the current URL. E.g: when fetching a single custom post type the framework will filter the returned posts to the one that matches the existing URL. Therefore, the framework needs to know the single prefix url for custom post types. This is required to properly handle parent pages that share the same child slug. See [post path mapping](/learn/pages-router/data-fetching/usepost/#post-path-matching) for more info.
100
100
101
-
It is also possible to pass a function, when doing so the default post types (post and pages) will be passed to the function. The code snipped below will disable [post path mapping](/learn/data-fetching/usepost/#post-path-matching) to the default post types.
101
+
It is also possible to pass a function, when doing so the default post types (post and pages) will be passed to the function. The code snipped below will disable [post path mapping](/learn/pages-router/data-fetching/usepost/#post-path-matching) to the default post types.
102
102
103
103
```js title="headstartwp.config.js"
104
104
module.exports= {
@@ -201,10 +201,10 @@ This route would automatically handle the following URLs:
201
201
- /books/genre/genre-name/page/2 -> paginate books filtered by genre
202
202
203
203
:::caution
204
-
The code snippet above does not implement pre-fetching, which you probably want to. Check out the [pre-fetching docs](/learn/data-fetching/prefetching) for instructions.
204
+
The code snippet above does not implement pre-fetching, which you probably want to. Check out the [pre-fetching docs](/learn/pages-router/data-fetching/prefetching) for instructions.
205
205
:::
206
206
207
-
It is also possible to specify a function for 'customTaxonomies', when doing so the default taxonomies will be passed to the function. This can be used for instance to enable [archive path matching](/learn/data-fetching/useposts#archive-path-matching).
207
+
It is also possible to specify a function for 'customTaxonomies', when doing so the default taxonomies will be passed to the function. This can be used for instance to enable [archive path matching](/learn/pages-router/data-fetching/useposts#archive-path-matching).
208
208
209
209
```js title="headstartwp.config.js"
210
210
module.exports= {
@@ -281,8 +281,8 @@ module.exports = {
281
281
}
282
282
```
283
283
284
-
More for info check out the [preview docs](/learn/wordpress-integration/previews#the-usepostlinkforredirect-setting).
284
+
More for info check out the [preview docs](/learn/pages-router/wordpress-integration/previews#the-usepostlinkforredirect-setting).
285
285
286
286
## cache
287
287
288
-
See [caching](/learn/data-fetching/caching/) docs.
288
+
See [caching](/learn/pages-router/data-fetching/caching/) docs.
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-pages-router/02-Data Fetching/usePost.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Example where path does not match but is redirected to the right one:
67
67
- User visits URL`/post-name`
68
68
- The post with the `post-name` slug contains a `http://backend.com/2022/10/30/post-name` url
69
69
- Since the URL and the path of`post.link`do not match, a NotFound error is thrown
70
-
- If prefetching is setup following [pre-fetching](/learn/data-fetching/prefetching) and `redirectStrategy` is set to "404" or "always"in`headstartwp.config.js`, `handleError` will then look if there's a redirect available and since WordPress redirects `/post-name` to `/2022/10/30/post-name`, the framework will also perform the redirect.
70
+
- If prefetching is setup following [pre-fetching](/learn/pages-router/data-fetching/prefetching) and `redirectStrategy` is set to "404" or "always"in`headstartwp.config.js`, `handleError` will then look if there's a redirect available and since WordPress redirects `/post-name` to `/2022/10/30/post-name`, the framework will also perform the redirect.
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-pages-router/02-Data Fetching/useTerms.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,5 +18,5 @@ const {
18
18
```
19
19
20
20
:::caution
21
-
You do not need to use `useTerms` if you simply need to access the term object for a taxonomy archive page (e.g category archive). You should use the `queriedObject` from the `usePosts` hook. See [usePosts docs](/learn/data-fetching/useposts/#queried-object) for more details.
21
+
You do not need to use `useTerms` if you simply need to access the term object for a taxonomy archive page (e.g category archive). You should use the `queriedObject` from the `usePosts` hook. See [usePosts docs](/learn/pages-router/data-fetching/useposts/#queried-object) for more details.
The [withHeadstartWPConfig](/docs/api/namespaces/headstartwp_next.config/#withheadstartwpconfig) function will detect the presence of the Linaria packages and will enable the build steps necessary to compile Linaria.
9
+
The [withHeadstartWPConfig](/api/namespaces/headstartwp_next.config/#withheadstartwpconfig) function will detect the presence of the Linaria packages and will enable the build steps necessary to compile Linaria.
10
10
11
11
:::caution
12
12
If you're on a monorepo setup, these packages should be installed on the Next.js project.
0 commit comments