Articles in this section

pathcase helper

The pathcase helper converts a string to path/case format by replacing spaces, dashes, underscores, and other non-word characters with forward slashes and lowercasing the result. Use it to generate folder-like paths, URL fragments, or grouping keys.

Syntax

{{pathcase value}}

value -- The string to convert. Required. Non-string inputs (numbers, booleans) are converted to strings before processing. Arrays of primitive values are converted to a comma-separated string. Objects and object arrays produce unusable output.

Examples

Convert a mixed-separator string

{{pathcase record.input}}

Input:

{ "record": { "input": "a-b-c d_e" } }

Output: a/b/c/d/e

Existing hyphens, spaces, and underscores are all normalized to a single /.

Split at camelCase boundaries

{{pathcase record.name}}

Input:

{ "record": { "name": "getUserProfile" } }

Output: get/user/profile

The helper inserts slashes at camelCase and PascalCase word boundaries.

Usage notes

  • All word separators (spaces, dashes, underscores, and other non-word characters) are normalized to a single /.
  • Multiple consecutive separators are collapsed into a single slash.
  • The output is always lowercased. Digits are preserved (e.g. v2 remains v2).
  • Slashes are inserted at camelCase and PascalCase boundaries.
  • Do not pass objects or object arrays -- the output will be unusable.