Skip to content

Commit

Permalink
dependency bump
Browse files Browse the repository at this point in the history
  • Loading branch information
gregrickaby committed Dec 18, 2023
1 parent a02ee01 commit da67737
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 79 deletions.
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please consider it a starting point for your next headless WordPress project.
- WordPress data via GraphQL
- Additional support for:
- Previews
- Static site generation (SSG)
- Static Site Generation (SSG)
- On-demand Revalidation
- Custom Post Types
- Custom Fields
Expand Down Expand Up @@ -151,7 +151,16 @@ define( 'NEXTJS_REVALIDATION_SECRET', 'revalidate' );

In order to query draft posts for Previews, you'll need to authenticate with WordPress. The following is a one-time step:

- Install the [WPGraphQL JWT Authentication](https://github.com/wp-graphql/wp-graphql-jwt-authentication) plugin
- Install and activate the [WPGraphQL JWT Authentication](https://github.com/wp-graphql/wp-graphql-jwt-authentication) plugin
- Generate a random string. I recommend using the [WordPress salt generator](https://api.wordpress.org/secret-key/1.1/salt/)
- Copy the string
- Open your `wp-config.php` file, and paste the string into the `GRAPHQL_JWT_AUTH_SECRET_KEY` constant. (Be sure to uncomment the constant by removing the `//` symbols.)

```php
// Optional. JWT auth refresh token.
define( 'GRAPHQL_JWT_AUTH_SECRET_KEY', 'some-random-string-generated-by-wp-salt' );
```

- Go to **GraphQL -> GraphiQL IDE** in your WordPress admin
- Copy the following and paste into GraphiQL IDE (replace `your_username` and `your_password` with your WordPress credentials)

Expand All @@ -178,15 +187,6 @@ mutation Login {
NEXTJS_AUTH_REFRESH_TOKEN="refresh-token-generated-by-grapqh-query"
```

- Generate a random string. I recommend using the [WordPress salt generator](https://api.wordpress.org/secret-key/1.1/salt/)
- Copy the string
- Open your `wp-config.php` file, and paste the string into the `GRAPHQL_JWT_AUTH_SECRET_KEY` constant. (Be sure to uncomment the constant by removing the `//` symbols.)

```php
// Optional. JWT auth refresh token.
define( 'GRAPHQL_JWT_AUTH_SECRET_KEY', 'some-random-string-generated-by-wp-salt' );
```

You should now be able to preview draft posts in your Next.js app by clicking the **Preview** button in your WordPress admin.

### 8. Start the dev servers
Expand Down Expand Up @@ -301,6 +301,23 @@ Remember to add all the environment variables from `.env.local` to your producti

---

### Other

#### RSS Feed and Sitemap

RSS feed and the Sitemap are available at:

- <https://nextjswp.com/feed.xml>
- <https://nextjswp.com/sitemap.xml>

#### Previews

Previews are available at:

- <https://nextjswp.com/preview/120?secret=preview>

---

## Contributing

Contributions are welcome! Please see the [contributing guidelines](./CONTRIBUTING.md) for more information.
Expand Down
128 changes: 64 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
"devDependencies": {
"@evilmartians/lefthook": "^1.5.5",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20.10.4",
"@types/node": "^20.10.5",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.17",
"@types/react-dom": "^18.2.18",
"@types/xml-escape": "^1.1.3",
"autoprefixer": "^10.4.16",
"eslint": "^8.55.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.0.4",
"eslint-config-prettier": "^9.1.0",
"postcss": "^8.4.32",
"postcss-import": "^15.1.0",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.9",
"rimraf": "^5.0.5",
"sharp": "^0.33.0",
"sharp": "^0.33.1",
"stylelint": "^16.0.2",
"stylelint-config-standard": "^35.0.0",
"tailwindcss": "^3.3.6",
Expand Down

1 comment on commit da67737

@vercel
Copy link

@vercel vercel bot commented on da67737 Dec 18, 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.