From 1d4f21a5c78e08bd5eae857e316ece8915830dfe Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 3 Dec 2024 05:23:48 +0530 Subject: [PATCH 1/4] Updated: about publish assets --- .../2.vaahcms-2x/5.module/5.publish-assets.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 content/2.vaahcms-2x/5.module/5.publish-assets.md diff --git a/content/2.vaahcms-2x/5.module/5.publish-assets.md b/content/2.vaahcms-2x/5.module/5.publish-assets.md new file mode 100644 index 00000000..dc075d57 --- /dev/null +++ b/content/2.vaahcms-2x/5.module/5.publish-assets.md @@ -0,0 +1,18 @@ +--- +title: Publish assets +--- + + +## Overview +Publishing assets in a module typically refers to the process of making certain resources or files (like JavaScript, CSS, images, or other static files) available to the public or to other parts of your application. + +This functionality is particularly useful when you have access to a module but its assets are not yet available in your system. + +```php +POST /api/publish/assets/{slug} +``` + +## Description +This API allows you to publish the assets of a specific module, identified by its {slug}. +Even if the module is not currently installed in your system, +you can use this endpoint to make its assets available for use. From 3e85ff5fa8da42c9266e7ad64e8f9e8de1408b89 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 3 Dec 2024 05:36:10 +0530 Subject: [PATCH 2/4] Updated: response --- content/2.vaahcms-2x/5.module/5.publish-assets.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/2.vaahcms-2x/5.module/5.publish-assets.md b/content/2.vaahcms-2x/5.module/5.publish-assets.md index dc075d57..3a460e48 100644 --- a/content/2.vaahcms-2x/5.module/5.publish-assets.md +++ b/content/2.vaahcms-2x/5.module/5.publish-assets.md @@ -8,10 +8,21 @@ Publishing assets in a module typically refers to the process of making certain This functionality is particularly useful when you have access to a module but its assets are not yet available in your system. +#### API ```php POST /api/publish/assets/{slug} ``` +#### Response +```json +{ + "success": true, + "messages": [ + "Assets published." + ] +} +``` + ## Description This API allows you to publish the assets of a specific module, identified by its {slug}. Even if the module is not currently installed in your system, From ee0c8f63ec7f9d7fe50a1ec60363589d4496d149 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 3 Dec 2024 06:33:48 +0530 Subject: [PATCH 3/4] Updated: directory for publish assets --- .../3.getting-started/7.publish-assets.md | 60 +++++++++++++++++++ .../2.vaahcms-2x/5.module/5.publish-assets.md | 29 --------- 2 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 content/2.vaahcms-2x/3.getting-started/7.publish-assets.md delete mode 100644 content/2.vaahcms-2x/5.module/5.publish-assets.md diff --git a/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md b/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md new file mode 100644 index 00000000..bb0f8f4c --- /dev/null +++ b/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md @@ -0,0 +1,60 @@ +--- +title: Publish Assets +--- + + +## Overview +Publishing assets in VaahCMS refers to making specific resources or files +(e.g., JavaScript, CSS, images, or other static files) publicly accessible or usable within the application. + +This is especially helpful when you want to prepare assets for a **module** or **theme**, but its assets are not yet available in your system. + + + +## Ways to Publish Assets + +### From Backend (System-Level Publishing) + +VaahCMS provides a backend functionality that lets administrators manage and publish assets for +modules or themes. This method is ideal for users who have direct access to the VaahCMS backend. + +### Through the API (Remote Publishing via URL) + This API endpoint is designed for situations where you need to programmatically publish assets without accessing the VaahCMS backend. +It is particularly useful for developers automating deployment processes or working on remote systems. + + +#### API +```php +POST /api/publish/assets/{slug} +``` + +#### Response +```json +{ + "success": true, + "messages": [ + "Assets published." + ] +} +``` + +#### Error Response +```json +{ + "success": false, + "errors": [ + "Module/Theme not found." + ] +} +``` + +#### Use Case Scenarios +**Module Assets:** +For a module like Travels, use its slug (travels) to publish its assets either via the backend or the API. + +**Theme Assets:** +For a theme like Modern Theme, use the theme slug (modern-theme) to prepare its CSS and JS files for the application. + +## Description +This API allows you to publish the assets of a specific **module** or **theme**, identified by its {slug}. +you can use this endpoint to make its assets available for use. diff --git a/content/2.vaahcms-2x/5.module/5.publish-assets.md b/content/2.vaahcms-2x/5.module/5.publish-assets.md deleted file mode 100644 index 3a460e48..00000000 --- a/content/2.vaahcms-2x/5.module/5.publish-assets.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Publish assets ---- - - -## Overview -Publishing assets in a module typically refers to the process of making certain resources or files (like JavaScript, CSS, images, or other static files) available to the public or to other parts of your application. - -This functionality is particularly useful when you have access to a module but its assets are not yet available in your system. - -#### API -```php -POST /api/publish/assets/{slug} -``` - -#### Response -```json -{ - "success": true, - "messages": [ - "Assets published." - ] -} -``` - -## Description -This API allows you to publish the assets of a specific module, identified by its {slug}. -Even if the module is not currently installed in your system, -you can use this endpoint to make its assets available for use. From 3264d58b096a54d134d3928f34e8b1bf25254cd6 Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Tue, 3 Dec 2024 07:21:28 +0530 Subject: [PATCH 4/4] Updated: added hyperlink b/w module --- content/2.vaahcms-2x/3.getting-started/7.publish-assets.md | 4 +++- content/2.vaahcms-2x/4.the-basics/5.extend/1.modules.md | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md b/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md index bb0f8f4c..9bda2d72 100644 --- a/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md +++ b/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md @@ -13,11 +13,13 @@ This is especially helpful when you want to prepare assets for a **module** or * ## Ways to Publish Assets -### From Backend (System-Level Publishing) +### From Backend (System-Level Publishing) VaahCMS provides a backend functionality that lets administrators manage and publish assets for modules or themes. This method is ideal for users who have direct access to the VaahCMS backend. +For more information, see the [From VaahCMS Module ](../../../vaahcms-2x/the-basics/extend/modules#vaahcms-module){:target="_blank"} section. + ### Through the API (Remote Publishing via URL) This API endpoint is designed for situations where you need to programmatically publish assets without accessing the VaahCMS backend. It is particularly useful for developers automating deployment processes or working on remote systems. diff --git a/content/2.vaahcms-2x/4.the-basics/5.extend/1.modules.md b/content/2.vaahcms-2x/4.the-basics/5.extend/1.modules.md index 0fdbe7c4..77788c9e 100644 --- a/content/2.vaahcms-2x/4.the-basics/5.extend/1.modules.md +++ b/content/2.vaahcms-2x/4.the-basics/5.extend/1.modules.md @@ -61,6 +61,9 @@ By clicking on `Deactivate` button will Deactivate the module. It will put the required css and js files from resources to public folder so that all the properties can be use easily. +For more details, see the ways [How to Publish Assets](../../../vaahcms-2x/getting-started/publish-assets){:target="_blank"} guide. + + ### Import data