URL inputs

Last modified: March 27th, 2024

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

Single line input for relative, absolute and fully qualified URLs. URL inputs show a preview of the target. Previews for URLs without a protocol are requested prefixed with http://

URL inputs are shown for inputs configured with the type url, or for keys matching:

  • url
  • *_url
  • link
  • *_link
external_url key shown as a url input
internal_url key shown as a url input
link key shown as a url input
Naming convention
copied
external_url: https://bitbucket.org/
internal_url: /editing/visual-editor/
link: github.com
Naming convention
copied
{
  "external_url": "https://bitbucket.org/",
  "internal_url": "/editing/visual-editor/",
  "link": "github.com"
}
Naming convention
copied
external_url = "https://bitbucket.org/"
internal_url = "/editing/visual-editor/"
link = "github.com"
Input configuration
copied
another_website: https://github.com/
_inputs:
  another_website:
    type: url
Input configuration
copied
{
  "another_website": "https://github.com/",
  "_inputs": {
    "another_website": {
      "type": "url"
    }
  }
}
Input configuration
copied
another_website = "https://github.com/"

[_inputs.another_website]
type = "url"

Options#

URL inputs have the following available options:

paths - Object#

Paths to common folders. Each path is relative to global site source. If unset, the paths default to those configured in the global configuration. The available keys are:

  • uploads for the default path when linking to an existing site file.
  • dam_uploads for the default path when linking to an existing DAM file.
  • dam_static for the location of statically copied assets for DAM files.

uploads and dam_uploads have a number of dynamic placeholders available.

empty_type - string#

Set how an ‘empty’ value will be saved. Does not apply to existing empty values. Can be one of the following:

  • string - an empty value for this input will be stored as "".
  • null - an empty value for this input will be stored as a null value (default). This does not apply to TOML files.

Valid values#

Documented below are the valid formats for url inputs.

The lists of examples are non-exhaustive.

Empty/null value:

  • url:

Any valid string (quoted or unquoted):

  • url: ""
  • url: ''
  • url: example.com
  • url: "example.com"
  • url: 'example.com'
  • url: "https://example.com"

URLs containing : must be surrounded by quotes

Any valid string:

  • url = ""
  • url = ''
  • url = "example.com"
  • url = 'example.com'
  • url = "https://example.com"

Null value:

  • "url": null

Any valid string:

  • "url": ""
  • "url": "example.com"
  • "url": "https://example.com"

Related Articles

Open in a new tab