Skip to content

Commit 0a9d439

Browse files
committed
Added missing contribution docs. Removed back ticks from the plugin names.
1 parent d1d0b33 commit 0a9d439

File tree

9 files changed

+60
-31
lines changed

9 files changed

+60
-31
lines changed

docs/explanation/get-vs-post/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ curl -X POST \
5252

5353
# Summary
5454
While both methods have their uses, POST requests are generally recommended for WPGraphQL due to their flexibility, security advantages, and ability to handle complex queries. However, GET requests can be useful for simple, cacheable queries and is useful when paired with caching mechanisms like the Smart Cache plugin. Consider your specific use case, security requirements, and caching needs when choosing between the two methods.
55+
56+
## Contributing
57+
58+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/explanation/graphql-endpoints/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ add_filter( 'graphql_endpoint', 'my_new_graphql_endpoint' );
4242
```
4343
This code would change the default `/graphql` endpoint to `/my_endpoint`.
4444

45-
Alternatively, you can configure the endpoint directly in the **WPGraphQL Settings** under **GraphQL Endpoint**, without needing to modify your code.
45+
Alternatively, you can configure the endpoint directly in the **WPGraphQL Settings** under **GraphQL Endpoint**, without needing to modify your code.
46+
47+
## Contributing
48+
49+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/explanation/headless-authentication/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,8 @@ To tie everything together, we will provide:
104104
Our approach to authentication in headless WordPress emphasizes **modularity**, **security**, and developer **experience**. To support these principles, we will provide **ready-to-use code snippets** and **example boilerplate code** that you can easily integrate into your application.
105105

106106
## Example use case
107-
For example, if you're building a headless WordPress application with a React frontend, you can use our code snippets to implement Credentials authentication. You can integrate our boilerplate code for handling access tokens securely, including token storage and refresh logic, without needing to install additional dependencies.
107+
For example, if you're building a headless WordPress application with a React frontend, you can use our code snippets to implement Credentials authentication. You can integrate our boilerplate code for handling access tokens securely, including token storage and refresh logic, without needing to install additional dependencies.
108+
109+
## Contributing
110+
111+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/explanation/rendering-options/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,7 @@ Considerations
141141
* Styling Parity: Achieving perfect styling parity can be challenging due to the dynamic nature of WordPress styles.
142142

143143
* Maintenance: Styles may change with theme updates, customizations or major WordPress updates, requiring periodic updates in your headless application.
144+
145+
## Contributing
146+
147+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/explanation/routing/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,3 +469,7 @@ In traditional WordPress, custom post types (CPTs) are registered using `registe
469469
470470
- `/portfolio/` → Archive page for portfolio items
471471
- `/portfolio/project-name/` → Single portfolio item
472+
473+
## Contributing
474+
475+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/explanation/sitemaps/index.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ This route will serve the WordPress `sitemap.xml` in your Next.js application dy
108108
- **Cons**
109109
* Limited flexibility for custom frontend routes not defined in WordPress
110110
* Requires proper URL transformation to replace backend URLs with frontend URLs
111-
* May require additional handling for caching and performance
111+
* May require additional handling for caching and performance
112112
* May propagate any errors experienced in WordPress when proxying the `sitemap.xml`
113113

114114
2. **Generating a Sitemap from GraphQL Content**
@@ -133,13 +133,13 @@ export async function generateSitemap() {
133133
fetchAllPages(),
134134
]);
135135
const allContent = [
136-
...data.posts.nodes.map(post => ({
137-
slug: `posts/${post.slug}`,
138-
modified: post.modified
136+
...data.posts.nodes.map(post => ({
137+
slug: `posts/${post.slug}`,
138+
modified: post.modified
139139
})),
140-
...data.pages.nodes.map(page => ({
141-
slug: page.slug,
142-
modified: page.modified
140+
...data.pages.nodes.map(page => ({
141+
slug: page.slug,
142+
modified: page.modified
143143
})),
144144
// Add custom frontend routes here
145145
{ slug: '', modified: new Date().toISOString() }, // Homepage
@@ -159,17 +159,17 @@ export async function generateSitemap() {
159159
}
160160
export async function getServerSideProps({ res }) {
161161
const sitemap = await generateSitemap();
162-
162+
163163
res.setHeader('Content-Type', 'application/xml');
164164
res.write(sitemap);
165165
res.end();
166-
166+
167167
return { props: {} };
168168
}
169169

170170
export async function GET() {
171171
const sitemap = await generateSitemap();
172-
172+
173173
return new Response(sitemap, {
174174
headers: {
175175
'Content-Type': 'application/xml',
@@ -182,7 +182,7 @@ export async function GET() {
182182
* Ability to include custom frontend routes not defined in WordPress
183183
* Easy integration with Next.js data fetching methods
184184

185-
- **Cons**:
185+
- **Cons**:
186186
* More complex implementation than proxying
187187
* Requires manual updates to include new content types or custom routes
188188
* May require pagination handling for large sites
@@ -199,25 +199,25 @@ import { DOMParser } from 'xmldom';
199199
export async function GET() {
200200
const response = await fetch(`${process.env.WORDPRESS_URL}/wp-sitemap.xml`);
201201
const sitemapIndex = await response.text();
202-
202+
203203
const parser = new DOMParser();
204204
const xmlDoc = parser.parseFromString(sitemapIndex, 'text/xml');
205205
const sitemapUrls = Array.from(xmlDoc.getElementsByTagName('loc')).map(
206206
node => node.textContent
207207
);
208-
208+
209209
const processedSitemaps = await Promise.all(
210210
sitemapUrls.map(async (url) => {
211211
const sitemapResponse = await fetch(url);
212212
const sitemapContent = await sitemapResponse.text();
213-
213+
214214
return sitemapContent.replace(
215215
new RegExp(process.env.WORDPRESS_URL, 'g'),
216216
process.env.FRONTEND_URL
217217
);
218218
})
219219
);
220-
220+
221221
const frontendRoutesSitemap = `
222222
<?xml version="1.0" encoding="UTF-8"?>
223223
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -228,7 +228,7 @@ export async function GET() {
228228
<!-- Add more custom routes as needed -->
229229
</urlset>
230230
`;
231-
231+
232232
const combinedSitemap = `
233233
<?xml version="1.0" encoding="UTF-8"?>
234234
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
@@ -242,7 +242,7 @@ export async function GET() {
242242
</sitemap>
243243
</sitemapindex>
244244
`;
245-
245+
246246
return new Response(combinedSitemap, {
247247
headers: {
248248
'Content-Type': 'application/xml',
@@ -261,3 +261,7 @@ export async function GET() {
261261
* Most complex implementation of the three approaches.
262262
* Requires handling multiple sitemap files
263263
* May have performance implications if not properly cached
264+
265+
## Contributing
266+
267+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/how-to/nextjs-pages-router/enable-apq/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,7 @@ const client = new ApolloClient({
125125
On the Network tab you should see your query being sent as a GET request.
126126

127127
![Network tab of browser is open, showing the GraphQL query being sent as GET.](./images/gql-pq-get.png)
128+
129+
## Contributing
130+
131+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

docs/index.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: "Introduction"
33
description: "Introduction to the Headless WordPress Toolkit, a modern, framework-agnostic collection of plugins and packages for building headless WordPress applications."
44
---
55

6-
7-
# Introduction
8-
96
## What is the Headless WordPress Toolkit?
107

118
The Headless WordPress Toolkit is a modern, framework-agnostic toolkit for building headless WordPress applications. It provides a collection of plugins, packages, and examples to help developers make WordPress a better headless CMS.
@@ -18,18 +15,18 @@ The toolkit includes several WordPress plugins to enhance the headless experienc
1815

1916
| Plugin | Description |
2017
|--------|-------------|
21-
| [`hwp-previews`](../plugins/hwp-previews/) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
22-
| [`wpgraphql-webhooks`](../plugins/wpgraphql-webhooks/) | Extends WPGraphQL to support webhook subscriptions and dispatching for headless WordPress environments. |
23-
| [`wpgraphql-logging`](../plugins/wpgraphql-logging/) | Logging for WPGraphQL requests with granular lifecycle events and Monolog integration. |
24-
| [`wpgraphql-debug-extensions`](../plugins/wpgraphql-debug-extensions/) | Advanced debugging, performance analysis, and metric collection for WPGraphQL. |
18+
| [hwp-previews](../plugins/hwp-previews/) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
19+
| [wpgraphql-webhooks](../plugins/wpgraphql-webhooks/) | Extends WPGraphQL to support webhook subscriptions and dispatching for headless WordPress environments. |
20+
| [wpgraphql-logging](../plugins/wpgraphql-logging/) | Logging for WPGraphQL requests with granular lifecycle events and Monolog integration. |
21+
| [wpgraphql-debug-extensions](../plugins/wpgraphql-debug-extensions/) | Advanced debugging, performance analysis, and metric collection for WPGraphQL. |
2522

2623
You can find more information about installation in the [plugins documentation](../plugins/README.md).
2724

2825
## Packages
2926

3027
We provide NPM packages that can be used in your frontend applications. All packages use vanilla ES Modules with no build step.
3128

32-
- [`@wpengine/hwp-toolbar`](../packages/toolbar/) — in active development (not yet published)
29+
- [@wpengine/hwp-toolbar](../packages/toolbar/) — in active development (not yet published)
3330

3431
> [!NOTE]
3532
> No packages are published to npm yet. These are pre-release and subject to change.
@@ -41,3 +38,7 @@ This project contains a wide variety of examples demonstrating how to use the He
4138
Most examples include a `wp-env` setup, allowing you to fully configure a headless application with a single command.
4239

4340
For a full list of examples and how to run them, please see the [examples documentation](../examples/README.md).
41+
42+
## Contributing
43+
44+
If you feel like something is missing or you want to add documentation, we encourage you to contribute! Please check out our [Contributing Guide](https://github.com/wpengine/hwptoolkit/blob/main/CONTRIBUTING.md) for more details.

plugins/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ WordPress plugins for the Headless WordPress Toolkit. Each plugin is paired with
66

77
| Plugin | Description |
88
|--------|-------------|
9-
| [`hwp-previews`](./hwp-previews/README.md) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
10-
| [`wpgraphql-webhooks`](./wpgraphql-webhooks/README.md) | Extends WPGraphQL to support webhook subscriptions and dispatching for headless WordPress environments. |
11-
| [`wpgraphql-logging`](./wpgraphql-logging/README.md) | Logging for WPGraphQL requests with granular lifecycle events and Monolog integration. |
12-
| [`wpgraphql-debug-extensions`](./wpgraphql-debug-extensions/README.md) | Advanced debugging, performance analysis, and metric collection for WPGraphQL. |
9+
| [hwp-previews](./hwp-previews/README.md) | Headless Previews solution for WordPress: fully configurable preview URLs via the settings page which is framework agnostic. |
10+
| [wpgraphql-webhooks](./wpgraphql-webhooks/README.md) | Extends WPGraphQL to support webhook subscriptions and dispatching for headless WordPress environments. |
11+
| [wpgraphql-logging](./wpgraphql-logging/README.md) | Logging for WPGraphQL requests with granular lifecycle events and Monolog integration. |
12+
| [wpgraphql-debug-extensions](./wpgraphql-debug-extensions/README.md) | Advanced debugging, performance analysis, and metric collection for WPGraphQL. |
1313

1414
## Install
1515

0 commit comments

Comments
 (0)