π Path Configuration
When hosting ContentBuilder.js or its associated asset files in a different location β such as a CDN, cloud storage, or separate directory β you can use the following configuration options to ensure correct file loading and path resolution.
Hereβs an example of how to set up custom paths:
const builder = new ContentBuilder({
container: '.container',
// Base path for general assets
assetPath: 'https://path.to/assets/',
// Font assets path
fontAssetPath: 'https://path.to/assets/fonts/',
// Snippet file and related paths
snippetUrl: 'https://path.to/assets/minimalist-blocks/content.js', // Full URL to snippet file
snippetPath: 'https://path.to/assets/minimalist-blocks/', // Base path for images and resources
snippetPathReplace: [
'assets/minimalist-blocks/images/',
'https://path.to/assets/minimalist-blocks/images/'
], // Replace local image paths with remote URLs
// Module and plugin paths
modulePath: 'https://path.to/assets/modules/', // module files
pluginPath: 'https://path.to/contentbuilder/', // plugin files
// Media path for AI-generated content (e.g., random images)
mediaPath: 'https://path.to/assets/gallery/'
// Form Builder module paths
assetsFolder: 'https://path.to/assets/formfiles/',
exampleImageUrl: 'https://path.to/assets/formfiles/ai-V8Khk.jpg',
exampleVideoUrl: 'https://path.to/assets/formfiles/ai-thhyR.mp4',
exampleAudioUrl: 'https://path.to/assets/formfiles/ai-3EVMb.wav',
});
These settings allow full control over where ContentBuilder looks for external files β making it easy to host assets remotely or serve them from optimized delivery networks.