All shortcode parameters (as shown on the Parameters page) can be predefined to have sensible defaults for all your Calendly links.
This is particularly useful if you want to have a default type, and some styles defined for those, but at the same time, want to have the opportunity to tweak those parameters for specific pages, or even individuals.
There are four ways to provide parameters for Hugo Calendly Shortcode:
Only the first option (shortcode parameters) is available for the free, open-source version.
Site configuration, front matter, and/or data files as parameter sources are only available for Hugo Calendly Shortcode Plus (see features).
We can provide defaults in three locations:
Hugo’s site configuration file (ie. config.toml)
This is useful for global defaults. A shared style and colors that should apply to all embedded Calendly links/pages.
We could also provide shared UTM tracking parameters that are common. Such as source
and medium
.
Through Hugo data files (eg. in json format)
We can define a data file in the data/calendly/
folder, called default.json
and set the defaults there instead of using the site configuration, or in conjunction with it.
On a specific Hugo page, through its front matter parameters
Particularly useful for tweaks to the look & feel for a particular page.
We could also add more default UTM parameters such as campaign
and content
if w are using UTM.
Similar to the default data file above, we can also define custom parameters for individual users.
Assuming the shortcode has a dataSet
, it will look for a data file in .json
, .yaml
, or .toml
format under data/calendly/
that is starting with the value provided.
For example: If we add dataSet="janedoe"
to the shortcode, it will load pre-defined parameters from a prepared janedoe.json
(or .yaml
, or .toml
).
Hugo Calendly Shortcode Plus tries to infer parameter values by looking for values in the different locations in a specific order.
In order of priority:
data/calendly/janedoe.json
if dataSet="janedoe"
is set on the shortcode),data/calendly/default.json
),config.toml
).All of the above are optional, and higher priority values will be copied over lower ones, without removing parameters that have not been overridden.
I will use an example to illustrate the differences between shortcode parameter names.
This example is based on what it would look like in front matter. To see all options (Hugo site configuration, data files, and front matter) on one page, take a look at Complete parameter sets - samples.
In this example, I am using all parameters that makes sense for a popup link, including pageStyle.*
and utm.*
{{< calendly
calendar="bespokesy/demo1"
type="popupLink"
text="Find a time to talk with me"
pageStyle.bgColor=bf3b3b
pageStyle.textColor=8fa7d0
pageStyle.primaryColor=0679b2
pageStyle.hidePageDetails=true
pageStyle.hideGDPRBanner=true
utm.campaign="test campaign"
utm.source="test source"
utm.medium="test medium"
utm.content="test content"
utm.term="test term"
/>}}
{
"calendly": {
"calendar": "bespokesy/demo1",
"type": "popupLink",
"text": "Find a time to talk with me",
"style": {
"page": {
"background_color": "bf3b3b",
"text_color": "8fa7d0",
"primary_color": "0679b2",
"hide_gdpr_banner": true,
"hide_page_details": true
}
},
"utm": {
"campaign": "test campaign",
"source": "test source",
"medium": "test medium",
"content": "test content",
"term": "test term"
}
}
}
calendly:
calendar: "bespokesy/demo1"
type: "popupLink"
text: "Find a time to talk with me"
style:
page:
background_color: "bf3b3b"
text_color: "8fa7d0"
primary_color: "0679b2"
hide_gdpr_banner: true
hide_page_details: true
utm:
campaign: "test campaign"
source: "test source"
medium: "test medium"
content: "test content"
term: "test term"
[calendly]
calendar = "bespokesy/demo1"
type = "popupLink"
text = "Find a time to talk with me"
[calendly.style]
[calendly.style.page]
background_color = bf3b3b
text_color = 8fa7d0
primary_color = 0679b2
hide_page_details = true
hide_gdpr_banner = true
[calendly.utm]
campaign = "test campaign"
source = "test source"
medium = "test medium"
content = "test content"
term = "test term"
Note: the parameter prefix (in this example calendly.*
) will differ slightly depending on where you want to add them. For a full set of examples in all locations, have a look at Complete parameter sets - samples.
For more examples take a look at these demo pages: