Skip to content

Commit

Permalink
docs: some minor fixes (#533)
Browse files Browse the repository at this point in the history
I have read your excellent documentation and found some minor typos that
I have corrected in this PR.
  • Loading branch information
nicholasio authored Jun 27, 2023
2 parents d887d83 + 711564e commit 4557588
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/documentation/01-Getting Started/headless-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = {
archive: '/books',
},
],
cstomTaxonomies: [
customTaxonomies: [
{
slug: 'genre',
endpoint: '/wp-json/wp/v2/genre',
Expand All @@ -100,13 +100,13 @@ After adding a custom taxonomy to the config, you will be able to filter posts b
```js
usePost({ postType: ['book'], genre: 'action' });
usePosts({ postType:'book', genre: 'action' perPage: 10 });
useTerms({ taxonomy: 'genre' } );
useTerms({ taxonomy: 'genre' });
```

Additionally, if you have an archive route such as `/blog` or `/books` filtering for all registered taxonomies works out of the box. For instance, take the headless config above the following page route:

```js title=src/pages/books/[[...path]].js
import { usePosts} from '@headstartwp/next';
import { usePosts } from '@headstartwp/next';
const BooksPage = () => {
const { data, error, loading } = usePosts({postType: 'book'});

Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/01-Getting Started/quick-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The great thing about this is that you don’t need multiple Next.js routes to h

### Basic Data Fetching

Now let’s look at how data fetching for this route works. To make things easier to understand, let’s disregard `getStaticPaths` and `getStaticProps`functions.
Now let’s look at how data fetching for this route works. To make things easier to understand, let’s disregard `getStaticPaths` and `getStaticProps` functions.

```js title="src/params.js"
/**
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/01-Getting Started/wordpress-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Make sure to set up the path for installing this as a WordPress Plugin:

## Manual install

[Download the plugin's zip file](https://github.com/10up/tenup-headless-wp-plugin/archive/refs/heads/trunk.zip), manually move it to `wp-content/plugins` and activate the plugin.
[Download the plugin's zip file](https://github.com/10up/headstartwp-plugin/archive/refs/heads/trunk.zip), manually move it to `wp-content/plugins` and activate the plugin.

## Enter the front-end site URL.

Expand Down
6 changes: 3 additions & 3 deletions docs/documentation/02 - Data Fetching/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The following example uses the `useFetchPost` to manually fetch a page with the
import { useFetchPost } from '@headstartwp/core/react';

const Page = () => {
const { data: { post }, loading } = useFetchPost({ slug: 'about', post_type: 'page' } );
const { data: { post }, loading } = useFetchPost({ slug: 'about', post_type: 'page' });

if (loading) {
return 'Loading...';
Expand All @@ -43,7 +43,7 @@ const Page = () => {
You could omit the `slug` param by specifying the current path of the page and it will parse the path and extract matched params following the WordPress pretty permalinks convention.

```js
usePost({ post_type: 'page' }, {}, '/about' );
usePost({ post_type: 'page' }, {}, '/about');
```

By using the Next.js bindings and following the path catch-all route convention, the URL extraction is automatic.
Expand All @@ -54,7 +54,7 @@ import { usePost } from '@headstartwp/next';
const Page = () => {
// slug is automatically injected from the next.js router
// if you pass a slug it will override what's coming from the URL
const { loading, error, data } = usePost( { post_type: 'page' });
const { loading, error, data } = usePost({ post_type: 'page' });

if (loading) {
return 'Loading...';
Expand Down
3 changes: 1 addition & 2 deletions docs/documentation/06-WordPress Integration/previews.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ The preview feature requires the 10up's headless WordPress plugin installed. The

For previews to work, make sure the frontend URL is entered in WP settings as per instructions in [Installing WordPress Plugin](/learn/getting-started/installing-wordpress-plugin).

The logic for generating the JWT token and redirecting to the preview endpoint can be seen [here](https://github.com/10up/headstartwp/blob/develop/wp/tenup-headless-wp/includes/classes/Preview/preview.php).

The logic for generating the JWT token and redirecting to the preview endpoint can be seen [here](https://github.com/10up/headstartwp/blob/develop/wp/headless-wp/includes/classes/Preview/preview.php).
```php
$token = PreviewToken::generate(
[
Expand Down
6 changes: 3 additions & 3 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
showLastUpdateTime: true,
showLastUpdateAuthor: true,
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/site',
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/docs',
sidebarCollapsed: false,
},
],
Expand All @@ -75,7 +75,7 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
showLastUpdateTime: true,
showLastUpdateAuthor: true,
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/site',
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/docs',
sidebarCollapsed: false,
},
], */
Expand All @@ -87,7 +87,7 @@ const config = {
sidebarPath: require.resolve('./sidebars.js'),
showLastUpdateTime: true,
showLastUpdateAuthor: true,
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/site',
editUrl: 'https://github.com/10up/headstartwp/tree/trunk/docs',
sidebarCollapsed: false,
},
],
Expand Down

1 comment on commit 4557588

@vercel
Copy link

@vercel vercel bot commented on 4557588 Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.