Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bumpy-islands-bet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docs": patch
---

Fix the broken images on the docs
5 changes: 5 additions & 0 deletions .changeset/dry-clouds-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webtools-addon-sitemap": patch
---

Make sure the strapi-sitemap CLI is actually published to the /bin
5 changes: 5 additions & 0 deletions .changeset/great-worlds-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docs": patch
---

Update response structures for Strapi v5
5 changes: 5 additions & 0 deletions .changeset/rare-cups-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docs": patch
---

Add documentation for the slugify config
5 changes: 5 additions & 0 deletions .changeset/ripe-crabs-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"strapi-plugin-webtools": minor
---

New config 'slugify' to overwrite the slugify function of the plugin
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"playground:build": "cd playground && yarn build",
"playground:start": "cd playground && yarn start",
"playground:develop": "rm -rf playground/node_modules/.strapi/ && cd playground && yarn develop --watch-admin --bundler=vite",
"docs:start": "cd packages/docs/ && yarn start",
"docs:build": "cd packages/docs/ && yarn build",
"test:e2e": "cypress open",
"test:unit": "ENV_PATH=./playground/.env jest --verbose --runInBand --forceExit",
"test:integration": "ENV_PATH=./playground/.env jest --verbose --runInBand --forceExit --testMatch '**/healthcheck.test.js'"
Expand Down
3 changes: 1 addition & 2 deletions packages/addons/sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"files": [
"dist",
"xsl",
"strapi-admin.js",
"strapi-server.js"
"bin"
],
"bin": {
"strapi-sitemap": "./bin/strapi-sitemap"
Expand Down
96 changes: 44 additions & 52 deletions packages/docs/docs/api/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,16 @@ Other than the path parameter this endpoint should behave just like a native fin
{
"data": {
"id": 2,
"attributes": {
"title": "Robust Strapi plugins for your project",
"createdAt": "2023-11-28T21:06:51.727Z",
"updatedAt": "2024-08-10T09:19:43.568Z",
"publishedAt": "2023-12-10T12:54:15.699Z",
"locale": "en",
"body": "Try our open source plugins to enhance your Strapi project for free! For custom solutions please contact our team.",
"contentType": "api::home.home"
}
"documentId": "ke1s1aroaexv8jt03iuxn81g",
"title": "Robust Strapi plugins for your project",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"publishedAt": "2025-03-13T17:06:57.578Z",
"locale": "en",
"body": "Try our open source plugins to enhance your Strapi project for free! For custom solutions please contact our team.",
"contentType": "api::home.home"
},
"meta": {

}
"meta": {}
}

```
Expand Down Expand Up @@ -76,58 +73,53 @@ As it's a native findMany endpoint you can use all the parameters you're used to
"data": [
{
"id": 10,
"attributes": {
"url_path": "/articles",
"generated": true,
"contenttype": "api::page.page",
"createdAt": "2024-08-10T09:19:43.348Z",
"updatedAt": "2024-08-10T09:19:44.581Z",
"locale": "en"
}
"documentId": "ke1s1aroaexv8jt03iuxn81g",
"url_path": "/articles",
"generated": true,
"contenttype": "api::page.page",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"locale": "en"
},
{
"id": 14,
"attributes": {
"url_path": "/plugins",
"generated": true,
"contenttype": "api::page.page",
"createdAt": "2024-08-10T09:19:43.808Z",
"updatedAt": "2024-08-10T09:19:44.611Z",
"locale": "en"
}
"documentId": "f4x8aamrfaec0t5oea408n34",
"url_path": "/plugins",
"generated": true,
"contenttype": "api::page.page",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"locale": "en"
},
{
"id": 18,
"attributes": {
"url_path": "/privacy-policy",
"generated": null,
"contenttype": "api::page.page",
"createdAt": "2024-09-01T12:55:04.863Z",
"updatedAt": "2024-09-01T12:55:29.346Z",
"locale": "en"
}
"documentId": "fdg21vh8i5bzbbwjm50dwk60",
"url_path": "/privacy-policy",
"generated": null,
"contenttype": "api::page.page",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"locale": "en"
},
{
"id": 21,
"attributes": {
"url_path": "/terms-and-conditions",
"generated": null,
"contenttype": "api::page.page",
"createdAt": "2024-09-01T13:13:14.364Z",
"updatedAt": "2024-09-01T13:13:30.147Z",
"locale": "en"
}
"documentId": "so0mehxfna6l3o6i0aul75gr",
"url_path": "/terms-and-conditions",
"generated": null,
"contenttype": "api::page.page",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"locale": "en"
},
{
"id": 11,
"attributes": {
"url_path": "/",
"generated": null,
"contenttype": "api::home.home",
"createdAt": "2024-08-10T09:19:43.351Z",
"updatedAt": "2024-09-01T13:44:57.434Z",
"locale": "en"
}
"documentId": "idrdcm7f9cn3w7iex32t2hh3",
"url_path": "/",
"generated": null,
"contenttype": "api::home.home",
"createdAt": "2025-03-09T16:45:24.886Z",
"updatedAt": "2025-03-13T20:38:43.112Z",
"locale": "en"
},
],
"meta": {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/configuration/default-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Webtools allows you to create custom URL patterns, specifically tweaked to your
| Key | `default_pattern` |
| Required | false |
| Type | string |
| Default | `/[pluralName]/[id]` |
| Default | `/[pluralName]/[documentId]` |
12 changes: 8 additions & 4 deletions packages/docs/docs/configuration/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ The settings of the plugin can be overridden in the `config/plugins.js` file.
In the example below you can see how, and also what the default settings are.

```md title="config/plugins.js"
module.exports = ({ env }) => ({
// ...
'webtools': {
import deburr from 'lodash/deburr';
import toLower from 'lodash/toLower';
import kebabCase from 'lodash/kebabCase';

export default ({ env }) => ({
webtools: {
enabled: true,
config: {
default_pattern: "/[pluralName]/[id]",
default_pattern: "/[pluralName]/[documentId]",
website_url: null,
slugify: (fieldValue) => kebabCase(deburr(toLower(fieldValue))),
},
},
});
Expand Down
31 changes: 31 additions & 0 deletions packages/docs/docs/configuration/slugify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
sidebar_label: 'Slugify'
displayed_sidebar: webtoolsSidebar
slug: /configuration/slugify
---

# Slugify

This config can be used to overwrite the function that is used to slugify your URLs. The function takes a single parameter which is the path before being slugified. It expects the return value to be the slugified URL.

### Example:

```md title="config/plugins.js"
import deburr from 'lodash/deburr';
import toLower from 'lodash/toLower';
import kebabCase from 'lodash/kebabCase';

export default ({ env }) => ({
webtools: {
config: {
slugify: (fieldValue) => kebabCase(deburr(toLower(fieldValue))),
},
},
});
```

| Name | Details |
| ---- | ------- |
| Key | `slugify` |
| Required | false |
| Type | function |
2 changes: 1 addition & 1 deletion packages/docs/docs/getting-started/url-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ At the core of the plugin is URL alias. It's the idea that every page of a given

See below a screenshot of the URL alias popup that's used to set the unique path of your page.

<img src="/img/assets/webtools/url-alias.png" alt="URL alias" />
<img src="/webtools/img/assets/url-alias.png" alt="URL alias" />
4 changes: 2 additions & 2 deletions packages/docs/docs/getting-started/url-pattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Fields can be injected in the pattern by escaping them with `[]`.

The following field types are allowed in a pattern:

- `id`
- `documentId`
- `uid`
- `string`

See below a screenshot of the URL pattern creation form in Strapi.

<img src="/img/assets/webtools/url-pattern.png" alt="URL pattern" />
<img src="/webtools/img/assets/url-pattern.png" alt="URL pattern" />
2 changes: 1 addition & 1 deletion packages/docs/docs/getting-started/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ This plugin is specifically designed for usage in Strapi managed websites. Hence

See below a screenshot of how to enable webtools for a given collection type.

<img src="/img/assets/webtools/enable-webtools.png" alt="Enable webtools" />
<img src="/webtools/img/assets/enable-webtools.png" alt="Enable webtools" />
1 change: 1 addition & 0 deletions packages/docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const sidebars = {
"configuration/introduction",
"configuration/default-pattern",
"configuration/website-url",
"configuration/slugify",
],
},
// {
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import styles from './card.module.scss';
import IconArrow from '@site/static/img/assets/icons/arrow-right.svg';
import IconArrow from '@site/static/webtools/img/assets/icons/arrow-right.svg';

export function CardTitle({
as,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import clsx from 'clsx';
import React from 'react';
import Link from '@docusaurus/Link';
import IconArrow from '@site/static/img/assets/icons/arrow-right.svg';
import IconArrow from '@site/static/webtools/img/assets/icons/arrow-right.svg';
import styles from './link-with-arrow.module.scss';

export function LinkWithArrow({
Expand Down
Binary file not shown.
Binary file removed packages/docs/static/img/assets/config-sync/logo.png
Binary file not shown.