Manually configure URLs

Last modified: October 30th, 2024

By default, CloudCannon automatically detect the output URLs for your files and assigns them at build time. This is useful as you do not need to manually assign output URLs to each of your files.

However, this behavior may not be right for your Site if it has a larger number of files or custom Site configuration. For these Sites, CloudCannon's URLs assigning behavior may slow down your build time. For these Sites, you can disable automatic output URLs in CloudCannon and manually configure your output URLs.

Before disabling CloudCannon's automatic URL detection, you must configure the collections_config.[*].url key for all output Collections.

To manually configure your URLs:

  1. Navigate to the editing page under Site Settings.
  2. Click on the Edit your configuration file button to open your CloudCannon configuration file.
  3.  Navigate to the Collections array under the Collections and Paths section.
  4. Click on each output Collections in the Collections array and ensure you have configured the URL key for each Collection.
  5. When you are happy with your manually configured URLs for each output Collection, navigate to the Build Configuration page under Site Settings.
  6. Check the Manually Configure URLs flag under Build system options.
  7. Click the Update Configuration and Build button.

CloudCannon will immediately build your Site using the manually configured URLs.

A screenshot of the Build Configuration page shows the checkbox for Manually Configure URLs under the Build system options section.

If you would prefer to configure the output URLs for your Collections in the Source Editor or your local development environment, you can achieve the same configuration with the following code:

cloudcannon.config.yaml
copied
collections_config:
  blog:
    path: content/blog
    url: /travel/[slug].html

With automatic URL detection disabled, CloudCannon will use the explicitly configured output URL /travel/[slug].html for files in this Collection.

cloudcannon.config.json
copied
{
  "collections_config": {
    "blog": {
      "path": "content/blog",
      "url": "/travel/[slug].html"
    }
  }
}

With automatic URL detection disabled, CloudCannon will use the explicitly configured output URL /travel/[slug].html for files in this Collection.

Open in a new tab