diff --git a/.github/scripts/broken-pageref.js b/.github/scripts/broken-pageref.js new file mode 100644 index 000000000..b05f84698 --- /dev/null +++ b/.github/scripts/broken-pageref.js @@ -0,0 +1,64 @@ +// deno run --allow-read .github/scripts/broken-pageref.js + +import { resolve, dirname, fromFileUrl } from "https://deno.land/std/path/mod.ts"; +import { walk } from "https://deno.land/std/fs/mod.ts"; + +const rootDir = resolve(Deno.cwd()); + +async function findBrokenLinks() { + const brokenLinks = []; + + for await (const entry of walk(rootDir, { exts: ['.md'], followSymlinks: true })) { + if (entry.isFile) { + const content = await Deno.readTextFile(entry.path); + const matches = [...content.matchAll(/ { + console.log(`File: ${link.file}`); + console.log(`Relative Path: ${link.relativePath}`); + console.log(`Resolved Path: ${link.resolvedPath}`); + console.log('---'); + }); + Deno.exit(1) +} + +console.log('No broken links found.'); +Deno.exit(0) diff --git a/.github/workflows/markdown-style-check.yml b/.github/workflows/markdown-style-check.yml index 9735a105c..367389a75 100644 --- a/.github/workflows/markdown-style-check.yml +++ b/.github/workflows/markdown-style-check.yml @@ -13,6 +13,13 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - uses: denoland/setup-deno@v1 + with: + deno-version: "~1.32" + + - name: Check broken PageRef links + run: deno run --allow-read .github/scripts/broken-pageref.js + - name: Lint all files uses: docker://avtodev/markdown-lint:v1.5 with: diff --git a/concepts/api/store-api.md b/concepts/api/store-api.md index 0d3c406a5..e14254524 100644 --- a/concepts/api/store-api.md +++ b/concepts/api/store-api.md @@ -17,7 +17,7 @@ Whenever additional logic is added to Shopware, the method of the corresponding Using plugins, you can add custom routes to the Store API \(as well as any other routes\) and also register custom services. We don't force developers to provide API coverage for their functionalities. However, if you want to support headless applications, ensure that your plugin provides its functionalities through dedicated routes. - + ## What next? diff --git a/guides/plugins/plugins/administration/advanced-configuration/add-rule-assignment-configuration.md b/guides/plugins/plugins/administration/advanced-configuration/add-rule-assignment-configuration.md index 7eb52c277..0a35afa1b 100644 --- a/guides/plugins/plugins/administration/advanced-configuration/add-rule-assignment-configuration.md +++ b/guides/plugins/plugins/administration/advanced-configuration/add-rule-assignment-configuration.md @@ -22,7 +22,7 @@ You want to create a custom card in the rule assignment, where you can add or de This guide **does not** explain how to create a new plugin for Shopware 6. Head over to our Plugin base guide to learn how to create a plugin at first: - + ## Creating the index.js file diff --git a/guides/plugins/plugins/administration/data-handling-processing/search-custom-data.md b/guides/plugins/plugins/administration/data-handling-processing/search-custom-data.md index 608235ec0..99ecf41fc 100644 --- a/guides/plugins/plugins/administration/data-handling-processing/search-custom-data.md +++ b/guides/plugins/plugins/administration/data-handling-processing/search-custom-data.md @@ -26,17 +26,17 @@ Think twice about adding this shortcut because if every plugin adds their own se For this guide, it's necessary to have a running Shopware 6 instance and full access to both the files and a running plugin. See our plugin page guide to learn how to create your own plugins. - + In addition, you need a custom entity to add to the search to begin with. Head over to the following guide to learn how to achieve that: - + ## Support custom entity via search API To support an entity in the untyped global search, the entity has to be defined in one of the Administration Modules. - + Add the `entity` and `defaultSearchConfiguration` values to your module to make it available to the search bar component. diff --git a/guides/plugins/plugins/administration/data-handling-processing/using-custom-fields.md b/guides/plugins/plugins/administration/data-handling-processing/using-custom-fields.md index d9d3963ef..e0f69c7c6 100644 --- a/guides/plugins/plugins/administration/data-handling-processing/using-custom-fields.md +++ b/guides/plugins/plugins/administration/data-handling-processing/using-custom-fields.md @@ -11,15 +11,15 @@ nav: All you need for this guide is a running Shopware 6 instance, the files and preferably a registered module in your own plugin. Don't know how to create an own plugin yet? Head over to the following guide: - + In order to craft your module, you will need to create lots on own components. If you're not sure about how to do that, take a look at the corresponding guide: - + In addition, of course you need an entity with custom fields to be able to add those custom fields to your module to begin with. Here you can learn how to add your custom fields: - + ## Using custom fields in your module diff --git a/guides/plugins/plugins/administration/module-component-management/add-custom-component.md b/guides/plugins/plugins/administration/module-component-management/add-custom-component.md index 56ac1cd1f..224faa147 100644 --- a/guides/plugins/plugins/administration/module-component-management/add-custom-component.md +++ b/guides/plugins/plugins/administration/module-component-management/add-custom-component.md @@ -17,11 +17,11 @@ In this example, you will create a component that will print a 'Hello world!' ev This guide **does not** explain how to create a new plugin for Shopware 6. Head over to our Plugin base guide to learn how to create a plugin at first: - + If you want to work with entities in your custom component or page, it might be useful to take a look at how to create a custom entity guide first: - + Especially if you want to add a new page for an own module, you should consider looking at the process on how to add a custom module first. diff --git a/guides/plugins/plugins/administration/module-component-management/add-custom-field.md b/guides/plugins/plugins/administration/module-component-management/add-custom-field.md index 04bdba644..c3a5a469d 100644 --- a/guides/plugins/plugins/administration/module-component-management/add-custom-field.md +++ b/guides/plugins/plugins/administration/module-component-management/add-custom-field.md @@ -15,7 +15,7 @@ If you were wondering how to add a new input field to an existing module in the This guide **does not** explain how you can create a new plugin for Shopware 6. Head over to our plugin base guide to learn how to create a plugin at first: - + ## Injecting into the Administration diff --git a/guides/plugins/plugins/administration/module-component-management/add-custom-module.md b/guides/plugins/plugins/administration/module-component-management/add-custom-module.md index 28878361e..ee96cca38 100644 --- a/guides/plugins/plugins/administration/module-component-management/add-custom-module.md +++ b/guides/plugins/plugins/administration/module-component-management/add-custom-module.md @@ -15,7 +15,7 @@ Inside the `module` directory lies the list of several modules, each having thei This guide **does not** explain how to create a new plugin for Shopware 6. Head over to our Plugin base guide to learn how to create a plugin at first: - + ## Creating the index.js file @@ -69,7 +69,7 @@ In our case here, let's say we use the icon `default-shopping-paper-bag-product` ::: danger This is not the icon being used for a menu entry! The icon for that needs to be configured separately. -Please refer to the [Add a menu entry](add-menu-entry) guide for more information on this topic. +Please refer to the [Add a menu entry](../routing-navigation/add-menu-entry) guide for more information on this topic. ::: In addition, you're able to configure a title here, which will be used for the actual browser title. @@ -87,11 +87,11 @@ Those routes are configured as an object in a property named `routes`. We will c The next steps are covered in their own guides. The first one would be adding a menu entry, so please take a look at the guide regarding: - + The second one refers to setting up custom routes, its guide can be found in the guide on adding custom routes: - + ## Set up additional meta info @@ -299,8 +299,8 @@ In addition, you surely want to customize your module even more. You may want to try the following things: * [Add custom component](add-custom-component) -* [Add a menu entry](add-menu-entry) -* [Add a custom route](add-custom-route) +* [Add a menu entry](../routing-navigation/add-menu-entry) +* [Add a custom route](../routing-navigation/add-custom-route) * [Add a custom service](add-custom-service) * [Add translations](adding-snippets) * [Customizing another module](customizing-modules) diff --git a/guides/plugins/plugins/administration/routing-navigation/add-menu-entry.md b/guides/plugins/plugins/administration/routing-navigation/add-menu-entry.md index 35bd3a8df..c15214639 100644 --- a/guides/plugins/plugins/administration/routing-navigation/add-menu-entry.md +++ b/guides/plugins/plugins/administration/routing-navigation/add-menu-entry.md @@ -15,11 +15,11 @@ When it comes to the module configuration, the menu entry is one of the most imp This guide **does not** explain how to create a new plugin for Shopware 6. Head over to our Plugin base guide to learn how to create a plugin at first: - + Especially if you want to add a new page for an own module, you should consider to look at the process on how to add a custom module first. - + ## Creating a simple menu entry diff --git a/guides/plugins/plugins/administration/routing-navigation/add-new-tab.md b/guides/plugins/plugins/administration/routing-navigation/add-new-tab.md index 8c9e43c32..c172706b1 100644 --- a/guides/plugins/plugins/administration/routing-navigation/add-new-tab.md +++ b/guides/plugins/plugins/administration/routing-navigation/add-new-tab.md @@ -15,7 +15,7 @@ You want to create a new tab in the Administration? This guide gets you covered This guide requires you to already have a basic plugin running. If you don't know how to do this in the first place, have a look at our plugin base guide: - + In the course of this guide, you need to create a custom route. If you want to learn on how to create a custom component, please refer to the guide on it: @@ -23,7 +23,7 @@ In the course of this guide, you need to create a custom route. If you want to l Also, we will use a small, custom component to fill our custom tab. In order to get used to that, it might come in handy to read the corresponding guide first: - + ::: info diff --git a/guides/plugins/plugins/administration/templates-styling/add-custom-styles.md b/guides/plugins/plugins/administration/templates-styling/add-custom-styles.md index 74f9598b9..f23f6349f 100644 --- a/guides/plugins/plugins/administration/templates-styling/add-custom-styles.md +++ b/guides/plugins/plugins/administration/templates-styling/add-custom-styles.md @@ -15,13 +15,13 @@ All components contain own templates and some style. Of course, you may want to However, this guide does not explain how to create a custom component, so head over to the official guide about creating a custom component to learn this first. - + In addition, you need to have a basic knowledge of CSS and SCSS in order to use custom styles. This is though considered a basic requirement and won't be taught in this guide. ### Example: Custom cms block -We will base our guide on an example: Let's use a custom component printing out "Hello world!". So first of all, create a new directory for your`sw-hello-world`. As said before, more information about that topic, such as where to create this directory, can be found in [Add a custom component](add-custom-component). +We will base our guide on an example: Let's use a custom component printing out "Hello world!". So first of all, create a new directory for your`sw-hello-world`. As said before, more information about that topic, such as where to create this directory, can be found in [Add a custom component](../module-component-management/add-custom-component). In your component's directory, create a new `index.js` file and register your custom component `sw-hello-world`: diff --git a/guides/plugins/plugins/administration/templates-styling/using-assets.md b/guides/plugins/plugins/administration/templates-styling/using-assets.md index cce52c4c5..32f8be4d0 100644 --- a/guides/plugins/plugins/administration/templates-styling/using-assets.md +++ b/guides/plugins/plugins/administration/templates-styling/using-assets.md @@ -15,7 +15,7 @@ When working with an own plugin, the usage of own custom images or other assets In order to be able to start with this guide, you need to have an own plugin running. As to most guides, this guide is also built upon the Plugin base guide: - + Needless to say, you should have your image or another asset at hand to work with. diff --git a/guides/plugins/plugins/administration/ui-ux/adding-responsive-behavior.md b/guides/plugins/plugins/administration/ui-ux/adding-responsive-behavior.md index f07cd701d..3e54bc703 100644 --- a/guides/plugins/plugins/administration/ui-ux/adding-responsive-behavior.md +++ b/guides/plugins/plugins/administration/ui-ux/adding-responsive-behavior.md @@ -11,7 +11,7 @@ nav: The Shopware 6 Administration provides two ways of adding classes to elements based on their size, the device helper and the `v-responsive` directive. Alternatively you can use `css` media queries to make your plugin responsive. Learn how to use `css` here: - + ## DeviceHelper diff --git a/guides/plugins/plugins/content/cms/add-cms-element.md b/guides/plugins/plugins/content/cms/add-cms-element.md index 6743bdc3c..c57010358 100644 --- a/guides/plugins/plugins/content/cms/add-cms-element.md +++ b/guides/plugins/plugins/content/cms/add-cms-element.md @@ -18,7 +18,7 @@ You won't learn how to create a plugin in this guide, head over to our Plugin ba This guide will also not explain how a custom component can be created in general, so head over to the official guide about creating a custom component to learn this first. - + ## Creating your custom element diff --git a/guides/plugins/plugins/framework/custom-field/add-custom-field.md b/guides/plugins/plugins/framework/custom-field/add-custom-field.md index 4fc689782..6254529a2 100644 --- a/guides/plugins/plugins/framework/custom-field/add-custom-field.md +++ b/guides/plugins/plugins/framework/custom-field/add-custom-field.md @@ -283,7 +283,7 @@ To update or delete a `custom_field_set`, you can use the standard repository me While theoretically your custom field is now properly defined for the Administration, you'll still have to do some work in your custom entities' Administration module. Head over to this guide to learn how to add your field to the Administration: - + ## Next steps diff --git a/guides/plugins/plugins/storefront/use-media-thumbnails.md b/guides/plugins/plugins/storefront/use-media-thumbnails.md index 31e06a4a1..50056bbcb 100644 --- a/guides/plugins/plugins/storefront/use-media-thumbnails.md +++ b/guides/plugins/plugins/storefront/use-media-thumbnails.md @@ -19,7 +19,7 @@ In order to use your own media files or thumbnails of your plugin in the Storefr Displaying custom images is often done by using custom fields. To take full advantage of this guide, you might want to read the corresponding guide on using custom fields: - + ## Using searchMedia function