Skip to content

Commit 6a0e8fa

Browse files
committed
Merge branch 'develop' into trunk
2 parents 0797851 + 3050989 commit 6a0e8fa

7 files changed

Lines changed: 44 additions & 47 deletions

File tree

docs/documentation/01-Getting Started/headless-config.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545

4646
## Splitting client/server config
4747

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/).
4949

5050
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.
5151

@@ -196,9 +196,6 @@ This route would automatically handle the following URLs:
196196
- /books/genre/genre-name -> filter books by genre
197197
- /books/genre/genre-name/page/2 -> paginate books filtered by genre
198198
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-
:::
202199
203200
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.
204201

docs/versioned_docs/version-pages-router/01-Getting Started/headless-config.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module.exports = {
4545

4646
## Splitting client/server config
4747

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/).
4949

5050
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.
5151

@@ -96,9 +96,9 @@ usePosts({ postType:'book', perPage: 10 });
9696

9797
The `single` option is required for several things including:
9898
- 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.
100100

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.
102102

103103
```js title="headstartwp.config.js"
104104
module.exports = {
@@ -201,10 +201,10 @@ This route would automatically handle the following URLs:
201201
- /books/genre/genre-name/page/2 -> paginate books filtered by genre
202202
203203
:::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.
205205
:::
206206
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).
208208
209209
```js title="headstartwp.config.js"
210210
module.exports = {
@@ -281,8 +281,8 @@ module.exports = {
281281
}
282282
```
283283
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).
285285
286286
## cache
287287
288-
See [caching](/learn/data-fetching/caching/) docs.
288+
See [caching](/learn/pages-router/data-fetching/caching/) docs.

docs/versioned_docs/version-pages-router/02-Data Fetching/usePost.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Example where path does not match but is redirected to the right one:
6767
- User visits URL `/post-name`
6868
- The post with the `post-name` slug contains a `http://backend.com/2022/10/30/post-name` url
6969
- 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.
7171
7272
7373
### Fetching from multiple post types

docs/versioned_docs/version-pages-router/02-Data Fetching/useSearch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The route will automatically render the latest 10 posts if no search term is pro
4848
4949
## QueriedObject
5050
51-
The `useSearch` hook also exposes a `queriedObject`. See [usePosts docs](/learn/data-fetching/useposts/#queried-object) for more info.
51+
The `useSearch` hook also exposes a `queriedObject`. See [usePosts docs](/learn/pages-router/data-fetching/useposts/#queried-object) for more info.
5252
5353
The queried object for for this hook is an object of type [SearchEntity](/api/interfaces/headstartwp_core.SearchEntity/).
5454

docs/versioned_docs/version-pages-router/02-Data Fetching/useTerms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ const {
1818
```
1919

2020
:::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.
2222
:::

docs/versioned_docs/version-pages-router/08-Guides/linaria.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ HeadstartWP offers a straightforward integration with [Linaria](https://github.c
66
npm install --save-dev @linaria/babel-preset @linaria/core @linaria/react @linaria/shaker @linaria/webpack-loader
77
```
88

9-
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.
1010

1111
:::caution
1212
If you're on a monorepo setup, these packages should be installed on the Next.js project.

package-lock.json

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)