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..9bda2d72 --- /dev/null +++ b/content/2.vaahcms-2x/3.getting-started/7.publish-assets.md @@ -0,0 +1,62 @@ +--- +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. + +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. + + +#### API +```php +POST <public-url>/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/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. + + <img src="/images/publish-assets.png"> ### Import data