Skip to content

Introduction to Cloney Template Functions

Cloney Template Functions are custom functions provided by Cloney to enhance your template customization capabilities. These functions allow you to perform dynamic operations and generate content tailored to your specific needs within your Cloney templates.

What Are Cloney Template Functions?

Cloney Template Functions are predefined functions that you can use directly within your Cloney templates. These functions are designed to simplify common tasks and provide you with powerful tools for generating content, making decisions, and handling data.

How to Use Cloney Template Functions

To use Cloney Template Functions in your templates, you can call them directly within your template code. Each function has a specific purpose and may or may not require parameters. You can incorporate these functions into your templates to create dynamic and context-aware content.

Available Cloney Template Functions

Here is a list of some of the Cloney Template Functions available for your use:

  • os: Returns the user's operating system.
  • arch: Returns the user's operating system architecture.
  • joinSingleQuote: Joins the elements of a list with a specified separator and encloses them in single quotes.
  • joinDoubleQuote: Joins the elements of a list with a specified separator and encloses them in double quotes.
  • toFile: Writes the output of a template to a file.

Sprig Functions

Additionally, you can explore a wide range of custom functions provided by the Sprig library, which is integrated into Cloney's template engine. These functions can further expand your template capabilities.