diff --git a/content/docs/en/activitylog.mdx b/content/docs/en/activitylog.mdx new file mode 100644 index 000000000..143fd8927 --- /dev/null +++ b/content/docs/en/activitylog.mdx @@ -0,0 +1,107 @@ +--- +sidebar_label: Activity Log +sidebar_position: 14 +--- + +import Zoom from 'react-medium-image-zoom'; +import 'react-medium-image-zoom/dist/styles.css'; + +# Activity Log + +The Activity Log provides a complete audit trail of all actions performed by users on the platform. It records every create, update, and delete operation across all resources, allowing you to track who did what and when. + +## FAQs + +
+ +### What actions are recorded in the Activity Log? + +The Activity Log records all three types of operations performed on platform +resources: +- **Create** — A new resource was created. +- **Update** — An existing resource was modified. +- **Delete** — A resource was deleted. +
+ +
+ +### What resources are tracked? + +The Activity Log tracks actions on all major platform resources, including: +- Clusters +- Projects +- Environments +- Services +- Jobs +- Deployments +- Dependencies +- Variable Groups +- Domains +- Node Pools +- Volumes +- Providers +- Users +
+ +
+ +### Can I navigate to the resource from the Activity Log? + +Yes. Clicking on the resource icon in the **Name** column takes you directly +to that resource's detail page. If the resource has been deleted, the link is +disabled and navigation is not available. +
+ +
+ +### Can I filter the Activity Log? + +Yes. You can filter by user, action type (Create, Update, Delete), resource +type, and date range. See the [Filtering the Activity +Log](#filtering-the-activity-log) section for details. +
+ +## Accessing the Activity Log + +A summary of the most recent platform activity is visible on the main Dashboard as the **Last Activity** card. It shows the last actions. Click **View all** at the bottom of the card to open the full Activity Log page. + + + activitylog-dashboard-card + + +## Understanding the Activity Log Table + +The table displays four columns: + +| **Column** | **Description** | +| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **Name** | The name of the affected resource, along with an icon representing its type and the account it belongs to. Click the icon to navigate to the resource (unavailable for deleted resources). | +| **Action** | A badge showing the type of operation: **Create**, **Update**, or **Delete**. | +| **Created At** | The relative time when the action occurred. Hover over it to see the full date and time. | +| **User** | The full name of the user who performed the action. | + + + activitylog-table + + +## Filtering the Activity Log + +Use the search input and filter bar at the top of the page to narrow down the results. Filters can be combined. + + + activitylog-filters + + +| **Filter** | **Description** | +| -------------- | --------------------------------------------------------------------------------------- | +| **Search** | Free-text search by resource name or action type. | +| **User** | Show only activities performed by a specific user. | +| **Action** | Show only Create, Update, or Delete actions. | +| **Type** | Show only activities for a specific resource type (e.g., Cluster, Service, Deployment). | +| **Date Range** | Show only activities within a specific time period. | diff --git a/content/docs/en/image-test.mdx b/content/docs/en/image-test.mdx new file mode 100644 index 000000000..9b45fb307 --- /dev/null +++ b/content/docs/en/image-test.mdx @@ -0,0 +1,11 @@ +--- +title: Image test +sidebar_label: image test +sidebar_position: 9 +--- + +![test](../image-test/download.jpeg "test") + +![image2](../image-test/download%20%281%29.jpeg "image2") + +testting diff --git a/content/docs/en/image-test/download (1).jpeg b/content/docs/en/image-test/download (1).jpeg new file mode 100644 index 000000000..7185542a7 Binary files /dev/null and b/content/docs/en/image-test/download (1).jpeg differ diff --git a/content/docs/en/image-test/download.jpeg b/content/docs/en/image-test/download.jpeg new file mode 100644 index 000000000..1b053cf2f Binary files /dev/null and b/content/docs/en/image-test/download.jpeg differ diff --git a/content/docs/en/provider/index.mdx b/content/docs/en/provider/index.mdx index bc5b44abd..20c266c41 100644 --- a/content/docs/en/provider/index.mdx +++ b/content/docs/en/provider/index.mdx @@ -19,7 +19,7 @@ In order to provide you with a clear view of your AWS cost and resources, SleakO ### 1. Navigate to the providers section -Into the *Left Pane*, access the *Setting* option and then *Providers* and then, at the top right corner, click on the *Create* button. +Into the *Left Panel*, access the *Settings* option, then *Providers* and lastly, at the top right corner, click on the *Create* button. +After the process is completed, you will be redirected to the dashboard. + ### 5. Learn about the infrastructure architecture created by SleakOps for you. In order to understand what was created on your AWS, please see [Accounts](/docs/provider/accounts). diff --git a/content/docs/en/subscribe-using-aws.mdx b/content/docs/en/subscribe-using-aws.mdx new file mode 100644 index 000000000..cfe16c443 --- /dev/null +++ b/content/docs/en/subscribe-using-aws.mdx @@ -0,0 +1,99 @@ +--- +title: Subscribe using AWS +sidebar_label: Subscribe using AWS +sidebar_position: 15 +--- + +import Zoom from 'react-medium-image-zoom'; +import 'react-medium-image-zoom/dist/styles.css'; + +# How to subscribe to SleakOps using AWS + +:::warning + +Follow this guide if you already have an account on SleakOps and it is not linked to your subscription on AWS. + +::: + +Welcome to our guide on how to subscribe to SleakOps using AWS. This step-by-step tutorial will provide you with all the necessary information and instructions you need to successfully subscribe and start enjoying the benefits of SleakOps through your AWS account. + +## Steps + +### 1. Log into SleakOps + +Log into SleakOps using an **Admin** account. + +### 2. Go to Settings > Subscription + +From the left menu, access the **Settings** option at the bottom, and then select the **Subscription** option. + + + Settings Menu + + + + Subscription Menu Item + + +### 3. Click on AWS Marketplace Linking + +Once the section is open, look for the **AWS Marketplace Linking** button and click on it. This action will redirect you to the SleakOps product overview in AWS. + + + AWS Marketplace Linking button + + +### 4. Complete the payment + +Click on the **Pricing** menu and complete the payment with the **Auto Renew** option selected. Currently, SleakOps only allows monthly payments. We are working on providing different options based on payment frequency. + + + AWS renewal settings - 1 month with Auto Renew enabled + + +### 5. Manage your subscription in AWS + +Once the payment is done, you need to manage your subscription in AWS. **Go to AWS Marketplace >> Manage Subscriptions**. Identify the SleakOps subscription and click on **Set up Product** under the details. + + + AWS Manage Subscriptions page showing SleakOps + + +You also have the option to complete the flow using the info modal, where you need to click **Set up your account**. + + + Set up your account modal + + +By using any of those options, you'll be redirected to SleakOps to confirm the action. + +### 6. Attach to SleakOps + +Once you are back on SleakOps, click on **Attach to SleakOps** to complete the linking. + + + Attach to SleakOps confirmation screen + + +That is all, you're ready to use SleakOps! diff --git a/content/docs/en/subscribe-using-aws/attach-to-sleakops.png b/content/docs/en/subscribe-using-aws/attach-to-sleakops.png new file mode 100644 index 000000000..202715e7a Binary files /dev/null and b/content/docs/en/subscribe-using-aws/attach-to-sleakops.png differ diff --git a/content/docs/en/subscribe-using-aws/aws-manage-subscriptions.png b/content/docs/en/subscribe-using-aws/aws-manage-subscriptions.png new file mode 100644 index 000000000..0b7ac432c Binary files /dev/null and b/content/docs/en/subscribe-using-aws/aws-manage-subscriptions.png differ diff --git a/content/docs/en/subscribe-using-aws/aws-marketplace-linking.png b/content/docs/en/subscribe-using-aws/aws-marketplace-linking.png new file mode 100644 index 000000000..a06b514dc Binary files /dev/null and b/content/docs/en/subscribe-using-aws/aws-marketplace-linking.png differ diff --git a/content/docs/en/subscribe-using-aws/aws-renewal-settings.png b/content/docs/en/subscribe-using-aws/aws-renewal-settings.png new file mode 100644 index 000000000..52df79d85 Binary files /dev/null and b/content/docs/en/subscribe-using-aws/aws-renewal-settings.png differ diff --git a/content/docs/en/subscribe-using-aws/aws-setup-account.png b/content/docs/en/subscribe-using-aws/aws-setup-account.png new file mode 100644 index 000000000..fd88350f9 Binary files /dev/null and b/content/docs/en/subscribe-using-aws/aws-setup-account.png differ diff --git a/content/docs/en/subscribe-using-aws/settings-menu.png b/content/docs/en/subscribe-using-aws/settings-menu.png new file mode 100644 index 000000000..94299da4d Binary files /dev/null and b/content/docs/en/subscribe-using-aws/settings-menu.png differ diff --git a/content/docs/en/subscribe-using-aws/subscription-menu.png b/content/docs/en/subscribe-using-aws/subscription-menu.png new file mode 100644 index 000000000..f31a976a2 Binary files /dev/null and b/content/docs/en/subscribe-using-aws/subscription-menu.png differ diff --git a/content/docs/es/activitylog.mdx b/content/docs/es/activitylog.mdx new file mode 100644 index 000000000..7e5acffe9 --- /dev/null +++ b/content/docs/es/activitylog.mdx @@ -0,0 +1,102 @@ +--- +sidebar_label: Registro de Actividad +sidebar_position: 14 +--- + +import Zoom from 'react-medium-image-zoom'; +import 'react-medium-image-zoom/dist/styles.css'; + +# Registro de Actividad + +El Registro de Actividad proporciona un historial completo de todas las acciones realizadas por los usuarios en la plataforma. Registra cada operación de creación, actualización y eliminación en todos los recursos, permitiéndote rastrear quién hizo qué y cuándo. + +## Preguntas Frecuentes + +
+ +### ¿Qué acciones se registran en el Registro de Actividad? + +El Registro de Actividad registra los tres tipos de operaciones realizadas sobre los recursos de la plataforma: +- **Crear** — Se creó un nuevo recurso. +- **Actualizar** — Se modificó un recurso existente. +- **Eliminar** — Se eliminó un recurso. +
+ +
+ +### ¿Qué recursos se rastrean? + +El Registro de Actividad rastrea las acciones sobre todos los recursos principales de la plataforma, incluyendo: +- Clusters +- Proyectos +- Entornos +- Servicios +- Jobs +- Deployments +- Dependencias +- Grupos de Variables +- Dominios +- Node Pools +- Volúmenes +- Proveedores +- Usuarios +
+ +
+ +### ¿Puedo navegar al recurso desde el Registro de Actividad? + +Sí. Al hacer clic en el ícono del recurso en la columna **Nombre**, accederás directamente a la página de detalle de ese recurso. Si el recurso ha sido eliminado, el enlace está deshabilitado y la navegación no está disponible. +
+ +
+ +### ¿Puedo filtrar el Registro de Actividad? + +Sí. Puedes filtrar por usuario, tipo de acción (Crear, Actualizar, Eliminar), tipo de recurso y rango de fechas. Consulta la sección [Filtrando el Registro de Actividad](#filtrando-el-registro-de-actividad) para más detalles. +
+ +## Accediendo al Registro de Actividad + +Un resumen de la actividad más reciente de la plataforma es visible en el Dashboard principal como la tarjeta **Última Actividad**. Muestra las últimas acciones. Haz clic en **Ver todos** en la parte inferior de la tarjeta para abrir la página completa del Registro de Actividad. + + + activitylog-dashboard-card + + +## Entendiendo la Tabla del Registro de Actividad + +La tabla muestra cuatro columnas: + +| **Columna** | **Descripción** | +| --- | --- | +| **Nombre** | El nombre del recurso afectado, junto con un ícono que representa su tipo y la cuenta a la que pertenece. Haz clic en el ícono para navegar al recurso (no disponible para recursos eliminados). | +| **Acción** | Una etiqueta que muestra el tipo de operación: **Crear**, **Actualizar** o **Eliminar**. | +| **Creado el** | El tiempo relativo en que ocurrió la acción. Pasa el cursor sobre él para ver la fecha y hora completa. | +| **Usuario** | El nombre completo del usuario que realizó la acción. | + + + activitylog-table + + +## Filtrando el Registro de Actividad + +Usa el campo de búsqueda y la barra de filtros en la parte superior de la página para reducir los resultados. Los filtros se pueden combinar. + + + activitylog-filters + + +| **Filtro** | **Descripción** | +| --- | --- | +| **Búsqueda** | Búsqueda de texto libre por nombre del recurso o tipo de acción. | +| **Usuario** | Muestra solo las actividades realizadas por un usuario específico. | +| **Acción** | Muestra solo acciones de Crear, Actualizar o Eliminar. | +| **Tipo** | Muestra solo actividades de un tipo de recurso específico (ej. Cluster, Servicio, Deployment). | +| **Rango de Fechas** | Muestra solo actividades dentro de un período de tiempo específico. | diff --git a/content/docs/es/image-test.mdx b/content/docs/es/image-test.mdx new file mode 100644 index 000000000..09693e056 --- /dev/null +++ b/content/docs/es/image-test.mdx @@ -0,0 +1,11 @@ +--- +title: Test de Imagen +sidebar_label: Test de imagen +sidebar_position: 9 +--- + +![test](../image-test/download.jpeg "test") + +![image2es](../image-test/download%20%281%29.jpeg "image2es") + +tteings diff --git a/content/docs/es/provider/index.mdx b/content/docs/es/provider/index.mdx index 3a4b541c1..4c9127c9b 100644 --- a/content/docs/es/provider/index.mdx +++ b/content/docs/es/provider/index.mdx @@ -19,7 +19,7 @@ Para proporcionarte una vista clara de tus costos y recursos en AWS, SleakOps ac ### 1. Navega a la sección de providers -En el *Panel Izquierdo*, accede a la opción *Configuración* y luego *Providers*. En la esquina superior derecha, haz clic en el botón *Crear*. +En el *Panel Izquierdo*, accede a la opción *Configuración*, luego *Providers* y por último, en la esquina superior derecha, haz clic en el botón *Crear*. +Luego de completado el proceso, serás redirigido al dashboard. + ### 5. Conoce la arquitectura de infraestructura creada por SleakOps para ti. Para entender lo que se creó en tu cuenta de AWS, consulta [Cuentas](/docs/provider/accounts). diff --git a/content/docs/es/subscribe-using-aws.mdx b/content/docs/es/subscribe-using-aws.mdx new file mode 100644 index 000000000..e7e4ef22a --- /dev/null +++ b/content/docs/es/subscribe-using-aws.mdx @@ -0,0 +1,99 @@ +--- +title: Suscribirse usando AWS +sidebar_label: Suscribirse usando AWS +sidebar_position: 15 +--- + +import Zoom from "react-medium-image-zoom"; +import "react-medium-image-zoom/dist/styles.css"; + +# Cómo suscribirse a SleakOps usando AWS + +:::warning + +Seguí esta guía si ya tenés una cuenta en SleakOps y no está vinculada a tu suscripción de AWS. + +::: + +Bienvenido a nuestra guía sobre cómo suscribirse a SleakOps usando AWS. Este tutorial paso a paso te brindará toda la información e instrucciones necesarias para suscribirte exitosamente y comenzar a disfrutar los beneficios de SleakOps a través de tu cuenta de AWS. + +## Pasos + +### 1. Iniciar sesión en SleakOps + +Inicia sesión en SleakOps usando una cuenta **Admin**. + +### 2. Ir a Settings > Subscription + +Desde el menú izquierdo, accedé a la opción **Settings** en la parte inferior, y luego seleccioná la opción **Subscription**. + + + Settings Menu + + + + Subscription Menu Item + + +### 3. Hacer clic en AWS Marketplace Linking + +Una vez abierta la sección, buscá el botón **AWS Marketplace Linking** y hacé clic en él. Esta acción te redirigirá al resumen del producto SleakOps en AWS. + + + AWS Marketplace Linking button + + +### 4. Completar el pago + +Hacé clic en el menú **Pricing** y completá el pago con la opción **Auto Renew** seleccionada. Actualmente, SleakOps solo permite pagos mensuales. Estamos trabajando para ofrecer diferentes opciones según la frecuencia de pago. + + + AWS renewal settings - 1 month with Auto Renew enabled + + +### 5. Gestionar la suscripción en AWS + +Una vez completado el pago, necesitás gestionar tu suscripción en AWS. Accedé a **AWS Marketplace >> Manage Subscriptions**. Identificá la suscripción de SleakOps y hacé clic en **Set up Product** dentro de los detalles. + + + AWS Manage Subscriptions page showing SleakOps + + +También podés completar el flujo usando el modal informativo, donde debés hacer clic en **Set up your account**. + + + Set up your account modal + + +Usando cualquiera de estas opciones, serás redirigido a SleakOps para confirmar la acción. + +### 6. Vincular a SleakOps + +Una vez de vuelta en SleakOps, hacé clic en **Attach to SleakOps** para completar la vinculación. + + + Attach to SleakOps confirmation screen + + +¡Eso es todo, ya estás listo para usar SleakOps! diff --git a/content/docs/es/subscribe-using-aws/attach-to-sleakops.png b/content/docs/es/subscribe-using-aws/attach-to-sleakops.png new file mode 100644 index 000000000..202715e7a Binary files /dev/null and b/content/docs/es/subscribe-using-aws/attach-to-sleakops.png differ diff --git a/content/docs/es/subscribe-using-aws/aws-manage-subscriptions.png b/content/docs/es/subscribe-using-aws/aws-manage-subscriptions.png new file mode 100644 index 000000000..0b7ac432c Binary files /dev/null and b/content/docs/es/subscribe-using-aws/aws-manage-subscriptions.png differ diff --git a/content/docs/es/subscribe-using-aws/aws-marketplace-linking.png b/content/docs/es/subscribe-using-aws/aws-marketplace-linking.png new file mode 100644 index 000000000..a06b514dc Binary files /dev/null and b/content/docs/es/subscribe-using-aws/aws-marketplace-linking.png differ diff --git a/content/docs/es/subscribe-using-aws/aws-renewal-settings.png b/content/docs/es/subscribe-using-aws/aws-renewal-settings.png new file mode 100644 index 000000000..52df79d85 Binary files /dev/null and b/content/docs/es/subscribe-using-aws/aws-renewal-settings.png differ diff --git a/content/docs/es/subscribe-using-aws/aws-setup-account.png b/content/docs/es/subscribe-using-aws/aws-setup-account.png new file mode 100644 index 000000000..fd88350f9 Binary files /dev/null and b/content/docs/es/subscribe-using-aws/aws-setup-account.png differ diff --git a/content/docs/es/subscribe-using-aws/settings-menu.png b/content/docs/es/subscribe-using-aws/settings-menu.png new file mode 100644 index 000000000..94299da4d Binary files /dev/null and b/content/docs/es/subscribe-using-aws/settings-menu.png differ diff --git a/content/docs/es/subscribe-using-aws/subscription-menu.png b/content/docs/es/subscribe-using-aws/subscription-menu.png new file mode 100644 index 000000000..f31a976a2 Binary files /dev/null and b/content/docs/es/subscribe-using-aws/subscription-menu.png differ diff --git a/docusaurus.config.js b/docusaurus.config.js index 110758479..c2da7bbb5 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -4,6 +4,8 @@ const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); +const isPreview = process.env.BASE_URL && process.env.BASE_URL !== "/"; + /** @type {import('@docusaurus/types').Config} */ const config = { title: "SleakOps Documentation", @@ -57,38 +59,40 @@ const config = { routeBasePath: "/docs", sidebarCollapsible: true, sidebarCollapsed: true, - editUrl: (/** @type {{ docPath: string }} */ { docPath }) => { - // Map document paths to their corresponding CMS collections - // docPath format: "cluster/addons/example.mdx" or "index.mdx" + editUrl: isPreview + ? (/** @type {{ docPath: string }} */ { docPath }) => { + // Map document paths to their corresponding CMS collections + // docPath format: "cluster/addons/example.mdx" or "index.mdx" - // Remove the file extension to get the slug - const slug = docPath.replace(/\.mdx?$/, ""); + // Remove the file extension to get the slug + const slug = docPath.replace(/\.mdx?$/, ""); - // Extract the path segments - const pathSegments = docPath.split("/"); + // Extract the path segments + const pathSegments = docPath.split("/"); - // Determine the collection based on the path structure - let collection = "docs-root"; // Default for root-level files + // Determine the collection based on the path structure + let collection = "docs-root"; // Default for root-level files - if (pathSegments.length >= 2) { - const firstSegment = pathSegments[0]; - const secondSegment = pathSegments[1]; + if (pathSegments.length >= 2) { + const firstSegment = pathSegments[0]; + const secondSegment = pathSegments[1]; - // Check for nested collections (e.g., cluster/addons, project/build) - if ( - pathSegments.length >= 3 && - secondSegment !== pathSegments[pathSegments.length - 1] - ) { - collection = `docs-${firstSegment}-${secondSegment}`; - } else { - // Single-level collections (e.g., cluster, domain, environment) - collection = `docs-${firstSegment}`; - } - } + // Check for nested collections (e.g., cluster/addons, project/build) + if ( + pathSegments.length >= 3 && + secondSegment !== pathSegments[pathSegments.length - 1] + ) { + collection = `docs-${firstSegment}-${secondSegment}`; + } else { + // Single-level collections (e.g., cluster, domain, environment) + collection = `docs-${firstSegment}`; + } + } - // Build the complete CMS URL with /entries/ and the slug - return `https://docs.sleakops.com/preview-docs/admin/#/collections/${collection}/entries/${slug}`; - }, + // Build the complete CMS URL with /entries/ and the slug + return `https://docs.sleakops.com/preview-docs/admin/#/collections/${collection}/entries/${slug}`; + } + : undefined, }, blog: {}, pages: { @@ -144,8 +148,9 @@ const config = { postsPerPage: 5, sortPosts: "descending", onUntruncatedBlogPosts: "ignore", - editUrl: - "https://docs.sleakops.com/preview-docs/admin/#/collections/changelog", + editUrl: isPreview + ? "https://docs.sleakops.com/preview-docs/admin/#/collections/changelog" + : undefined, }, ], [ @@ -161,8 +166,9 @@ const config = { path: "tutorials", routeBasePath: "tutorial", sidebarPath: require.resolve("./sidebars-tutorials.js"), - editUrl: - "https://docs.sleakops.com/preview-docs/admin/#/collections/tutorials", + editUrl: isPreview + ? "https://docs.sleakops.com/preview-docs/admin/#/collections/tutorials" + : undefined, }, ], ], diff --git a/static/img/activitylog/activitylog-dashboard-card.png b/static/img/activitylog/activitylog-dashboard-card.png new file mode 100644 index 000000000..0dbf7a117 Binary files /dev/null and b/static/img/activitylog/activitylog-dashboard-card.png differ diff --git a/static/img/activitylog/activitylog-filters.png b/static/img/activitylog/activitylog-filters.png new file mode 100644 index 000000000..69ce7b38c Binary files /dev/null and b/static/img/activitylog/activitylog-filters.png differ diff --git a/static/img/activitylog/activitylog-table.png b/static/img/activitylog/activitylog-table.png new file mode 100644 index 000000000..ec9d5fab9 Binary files /dev/null and b/static/img/activitylog/activitylog-table.png differ diff --git a/static/img/provider/providerconfirmdelete.png b/static/img/provider/providerconfirmdelete.png index ee3ced382..71a5abe26 100644 Binary files a/static/img/provider/providerconfirmdelete.png and b/static/img/provider/providerconfirmdelete.png differ diff --git a/static/img/provider/providerdelete.png b/static/img/provider/providerdelete.png index c066d6b95..f1fb0add5 100644 Binary files a/static/img/provider/providerdelete.png and b/static/img/provider/providerdelete.png differ diff --git a/static/img/provider/providererroracclimit.png b/static/img/provider/providererroracclimit.png index ff35eb16c..e92de75c5 100644 Binary files a/static/img/provider/providererroracclimit.png and b/static/img/provider/providererroracclimit.png differ diff --git a/static/img/provider/providererrordefault.png b/static/img/provider/providererrordefault.png index 760d9411a..9e20c9505 100644 Binary files a/static/img/provider/providererrordefault.png and b/static/img/provider/providererrordefault.png differ diff --git a/static/img/provider/providererrornonroot.png b/static/img/provider/providererrornonroot.png index 58e0bce21..bceec4366 100644 Binary files a/static/img/provider/providererrornonroot.png and b/static/img/provider/providererrornonroot.png differ diff --git a/static/img/provider/providerstep1.png b/static/img/provider/providerstep1.png index eb583d226..3deb89a42 100644 Binary files a/static/img/provider/providerstep1.png and b/static/img/provider/providerstep1.png differ diff --git a/static/img/provider/providerstep2.png b/static/img/provider/providerstep2.png index 70bedac02..0be72634e 100644 Binary files a/static/img/provider/providerstep2.png and b/static/img/provider/providerstep2.png differ diff --git a/static/img/provider/providerstep3.png b/static/img/provider/providerstep3.png index c8f15154d..9ddf4764e 100644 Binary files a/static/img/provider/providerstep3.png and b/static/img/provider/providerstep3.png differ diff --git a/static/img/provider/providerstep4.png b/static/img/provider/providerstep4.png index c0c8ca3da..cb815a54e 100644 Binary files a/static/img/provider/providerstep4.png and b/static/img/provider/providerstep4.png differ diff --git a/sync_content.js b/sync_content.js index 95ee35c8c..775387ab6 100644 --- a/sync_content.js +++ b/sync_content.js @@ -139,9 +139,143 @@ function syncTutorialImages() { return { count, synced }; } +/** + * Fix relative image paths in doc MDX files. + * + * The CMS generates co-located image references using either: + * - `../slug/image.png` (English files) + * - `slug/image.png` (Spanish/translated files) + * + * Both forms break when Docusaurus resolves them through symlinks. + * This function normalises them to `./slug/image.png`. + */ +function fixDocImagePaths() { + const locales = ["en", "es"]; + let fixedCount = 0; + const fixed = []; + + for (const locale of locales) { + const docsDir = path.join(ROOT, "content/docs", locale); + if (!fs.existsSync(docsDir)) continue; + + const files = fs.readdirSync(docsDir, { withFileTypes: true }); + const mdxFiles = files.filter( + (f) => f.isFile() && /\.mdx?$/i.test(f.name), + ); + + for (const mdxFile of mdxFiles) { + const filePath = path.join(docsDir, mdxFile.name); + const content = fs.readFileSync(filePath, "utf-8"); + + // Normalise image paths: ../slug/img.png or slug/img.png → ./slug/img.png + // Matches markdown images whose URL is a relative path (no protocol, not starting with ./ or /) + const newContent = content.replace( + /(\!\[[^\]]*\]\()(?:\.\.\/)?([a-zA-Z0-9_-]+\/[^\s)"]*?\.(?:png|jpg|jpeg|gif|webp|svg))/gi, + (match, prefix, rest) => { + const fixed = `${prefix}./${rest}`; + return fixed === match ? match : fixed; + }, + ); + + if (newContent !== content) { + const changes = newContent.split("\n").filter((line, i) => line !== content.split("\n")[i]).length; + fs.writeFileSync(filePath, newContent, "utf-8"); + fixedCount += changes; + fixed.push({ + file: path.relative(ROOT, filePath), + changes, + }); + } + } + } + + return { count: fixedCount, fixed }; +} + +/** + * Copy co-located image folders from the default locale (en) to other locales. + * + * When authors add images via the CMS, the image folder is only created under + * `content/docs/en//`. Translated docs reference the same images but + * `content/docs/es//` doesn't exist, so the build fails. + * + * This copies missing image folders from en → other locales. + */ +function syncDocImages() { + const IMAGE_RE = /\.(png|jpg|jpeg|gif|webp|svg)$/i; + const srcLocale = "en"; + const otherLocales = ["es"]; + const srcDir = path.join(ROOT, "content/docs", srcLocale); + let count = 0; + const synced = []; + + if (!fs.existsSync(srcDir)) return { count: 0, synced: [] }; + + const entries = fs.readdirSync(srcDir, { withFileTypes: true }); + + for (const entry of entries) { + if (!entry.isDirectory()) continue; + + const srcImgDir = path.join(srcDir, entry.name); + const imageFiles = fs.readdirSync(srcImgDir, { withFileTypes: true }) + .filter((f) => f.isFile() && IMAGE_RE.test(f.name)); + + if (imageFiles.length === 0) continue; + + for (const locale of otherLocales) { + const destImgDir = path.join(ROOT, "content/docs", locale, entry.name); + + // Check if the locale has a matching MDX that references these images + const mdxPath = path.join(ROOT, "content/docs", locale, `${entry.name}.mdx`); + if (!fs.existsSync(mdxPath)) continue; + + fs.mkdirSync(destImgDir, { recursive: true }); + + for (const imgFile of imageFiles) { + const srcPath = path.join(srcImgDir, imgFile.name); + const destPath = path.join(destImgDir, imgFile.name); + fs.copyFileSync(srcPath, destPath); + count++; + } + + synced.push({ + from: path.relative(ROOT, srcImgDir), + to: path.relative(ROOT, destImgDir), + images: imageFiles.length, + }); + } + } + + return { count, synced }; +} + function main() { + // Fix relative image paths generated by the CMS (must run before symlinking) + console.log("🖼️ Fixing doc image paths..."); + const pathStats = fixDocImagePaths(); + if (pathStats.count > 0) { + console.log(` ✓ Fixed ${pathStats.count} image path(s):`); + for (const item of pathStats.fixed) { + console.log(` ${item.file} (${item.changes} path(s))`); + } + } else { + console.log(" ℹ️ No doc image paths to fix"); + } + + // Copy co-located image folders from en to other locales + console.log("\n🖼️ Syncing doc images across locales..."); + const docImgStats = syncDocImages(); + if (docImgStats.count > 0) { + console.log(` ✓ Copied ${docImgStats.count} image(s):`); + for (const item of docImgStats.synced) { + console.log(` ${item.from} → ${item.to} (${item.images} image(s))`); + } + } else { + console.log(" ℹ️ No doc images to sync across locales"); + } + console.log( - "🔗 Linking content from CMS structure to Docusaurus structure...\n", + "\n🔗 Linking content from CMS structure to Docusaurus structure...\n", ); for (const mapping of SYNC_MAP) {