Skip to content

Enhance CMS Documentation and Add AI Provider Configuration #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
3 changes: 3 additions & 0 deletions dev-docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"aiProvider": "google"
}
17 changes: 17 additions & 0 deletions docusaurus/docs/cms/api/graphql.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
---
title: GraphQL API
displayed_sidebar: cmsSidebar
tags:
- API
- Content API
- documentId
- filters
- GraphQL
- mutation
- pagination
- pagination by offset
- pagination by page
- plural API ID
- sort
---
```markdown
---
title: GraphQL API
displayed_sidebar: cmsSidebar
tags:
- API
- Content API
Expand Down
29 changes: 29 additions & 0 deletions docusaurus/docs/cms/configurations/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ tags:
- host
- port
---
```md
---
title: Server configuration
sidebar_label: Server
description: Strapi offers a single entry point file for its server configuration.
displayed_sidebar: cmsSidebar
tags:
- app keys
- base configuration
- configuration
- cron job
- host
- port
---

# Server configuration

Expand Down Expand Up @@ -172,3 +186,18 @@ export default ({ env }) => ({

</TabItem>
</Tabs>

:::tip Important considerations for Development environments

When running Strapi in a development environment (`NODE_ENV=development`), the server configuration requires special attention, particularly concerning the `host` parameter. Due to changes in how Strapi constructs URLs, especially for the admin panel, the following points should be considered:

- **`host: 0.0.0.0`**: Setting the host to `0.0.0.0` is crucial for allowing external access to your Strapi application from other devices on your network. However, be aware that in some cases, this might not be sufficient for the admin panel to function correctly due to URL construction logic.

- **Accessing the Admin Panel**: If you encounter issues accessing the admin panel when using `0.0.0.0`, especially seeing a blank screen or errors related to the URL, try accessing the admin panel using `http://localhost:<port>/admin`.

- **IPv6 Addresses**: If your machine uses IPv6, and you set your host to an IPv6 address (e.g., `::1`), ensure your system correctly resolves this address. You might need to access your Strapi application using `http://[::1]:<port>/admin`.

- **Explicit Host Configuration**: For a more robust configuration in development, consider explicitly setting the `host` to `localhost` and verifying that your system resolves `localhost` correctly. This ensures that both the server and admin panel URLs are constructed correctly.

These considerations are important because Strapi dynamically generates URLs for the admin panel and other services based on the `host` and `port` configurations. Incorrectly configured hosts can lead to URL mismatches and prevent the admin panel from loading correctly.
:::
14 changes: 14 additions & 0 deletions docusaurus/docs/cms/features/preview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
---
title: Preview
description: >-
With the Preview feature, you can preview your front-end directly from the
Content Manager
displayedSidebar: userSidebar
toc_max_heading_level: 4
tags:
- content manager
- preview
- features
---
```markdown
---
title: Preview
description: With the Preview feature, you can preview your front-end directly from the Content Manager
displayedSidebar: userSidebar
toc_max_heading_level: 4
Expand Down Expand Up @@ -597,3 +610,4 @@ Additionally, you can:
:::note
In the Edit view of the Content Manager, the Open preview button will be disabled if you have unsaved changes. Save your latest changes and you should be able to preview content again.
:::
```
18 changes: 16 additions & 2 deletions docusaurus/docs/cms/features/users-permissions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
---
title: Users & Permissions
description: >-
Learn to use the Users & Permissions and API tokens features to manage
end-users.
toc_max_heading_level: 5
tags:
- admin panel
- users & permissions
- api tokens
- features
---
```markdown
---
title: Users & Permissions
description: Learn to use the Users & Permissions and API tokens features to manage end-users.
toc_max_heading_level: 5
tags:
Expand Down Expand Up @@ -246,7 +259,7 @@ Setting JWT expiry for more than 30 days is not recommended due to security conc

### Registration configuration

If you have added any additional fields in your User **model** <Annotation>Models, also called content-types in Strapi, define a representation of the content structure.<br/>Users are a special type of built-in content-type found in any new Strapi application. You can customize the Users model, adding more fields for instance, like any other models.<br/>For more information, please refer to the [models](/cms/backend-customization/models) documentation.</Annotation> that need to be accepted on registration, you need to added them to the list of allowed fields in the `config.register` object of [the `/config/plugins` file](/cms/configurations/plugins), otherwise they will not be accepted.
If you have added any additional fields in your User **model** <Annotation>Models, also called content-types in Strapi, define a representation of the content structure.<br/>Users are a special type of built-in content-type found in any new Strapi application. You can customize the Users model, adding more fields for instance, like any other models.<br/>For more information, please refer to the [models](/cms/backend-customization/models) documentation.</Annotation> that need to be accepted on registration, you need to added them to the list of allowed fields in the `config.register` object of [the `/config/plugins` file](/cms/configurations/plugins), otherwise they will not be accepted. By default, the `register.allowedFields` array is empty, meaning no additional fields are accepted unless explicitly configured.

The following example shows how to ensure a field called "nickname" is accepted by the API on user registration:

Expand Down Expand Up @@ -348,7 +361,7 @@ module.exports = {

<TabItem value="typescript" label="TypeScript">

```ts title="/extensions/users-permissions/config/jwt.ts"
```js title="/extensions/users-permissions/config/jwt.ts"

export default {
jwtSecret: process.env.SOME_ENV_VAR,
Expand Down Expand Up @@ -584,3 +597,4 @@ create: async ctx => {
ctx.created(data);
};
```
```
11 changes: 11 additions & 0 deletions docusaurus/docs/cms/migration/v4-to-v5/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ description: View the list of all breaking changes introduced between Strapi v4
displayed_sidebar: cmsSidebar
pagination_prev: cms/migration/v4-to-v5/step-by-step
pagination_next: cms/migration/v4-to-v5/additional-resources/introduction
tags:
- breaking changes
- upgrade to Strapi 5
---
```markdown
---
title: Breaking changes
description: View the list of all breaking changes introduced between Strapi v4 and v5.
displayed_sidebar: cmsSidebar
pagination_prev: cms/migration/v4-to-v5/step-by-step
pagination_next: cms/migration/v4-to-v5/additional-resources/introduction
tags:
- breaking changes
- upgrade to Strapi 5
Expand Down
38 changes: 17 additions & 21 deletions docusaurus/docs/cms/plugins/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
title: Upload plugin
displayed_sidebar: cmsSidebar
description: Upload any kind of file on your server or external providers.
tags:
- localServer
- provider
- plugins
- Upload plugin
- REST API
---
```markdown
---
title: Upload plugin
displayed_sidebar: cmsSidebar
description: Upload any kind of file on your server or external providers.
tags:
- localServer
- provider
Expand Down Expand Up @@ -265,11 +277,7 @@ export default ({ env }) => ({
upload: {
config: {
breakpoints: {
xlarge: 1920,
large: 1000,
medium: 750,
small: 500,
xsmall: 64
xlarge: 1920,\n large: 1000,\n medium: 750,\n small: 500,\n xsmall: 64
},
},
},
Expand Down Expand Up @@ -354,10 +362,7 @@ The following parameters are accepted:
form.addEventListener('submit', async (e) => {
e.preventDefault();

await fetch('/api/upload', {
method: 'post',
body: new FormData(e.target)
});
await fetch('/api/upload', {\n method: 'post',\n body: new FormData(e.target)\n });
});
</script>
```
Expand All @@ -375,10 +380,7 @@ const form = new FormData();

form.append('files', file, "1.png");

const response = await fetch('http://localhost:1337/api/upload', {
method: 'post',
body: form,
});
const response = await fetch('http://localhost:1337/api/upload', {\n method: 'post',\n body: form,\n});

```

Expand Down Expand Up @@ -442,10 +444,7 @@ The corresponding code is be:
form.addEventListener('submit', async (e) => {
e.preventDefault();

await fetch('/api/upload', {
method: 'post',
body: new FormData(e.target)
});
await fetch('/api/upload', {\n method: 'post',\n body: new FormData(e.target)\n });
});
</script>
```
Expand Down Expand Up @@ -529,9 +528,6 @@ const form = new FormData();

form.append('fileInfo', JSON.stringify(newFileData));

const response = await fetch(`http://localhost:1337/api/upload?id=${fileId}`, {
method: 'post',
body: form,
});
const response = await fetch(`http://localhost:1337/api/upload?id=${fileId}`, {\n method: 'post',\n body: form,\n});

```
9 changes: 9 additions & 0 deletions docusaurus/docs/cms/providers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
title: Providers
description: Install and use providers to extend the functionality of available plugins.
tags:
- environment
- providers
---
```markdown
---
title: Providers
description: Install and use providers to extend the functionality of available plugins.
tags:
- environment
- providers
Expand Down Expand Up @@ -489,3 +497,4 @@ export = {
</Tabs>

<FeedbackPlaceholder />
```