This repository was archived by the owner on Dec 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +316
-31
lines changed
configs/copier-config-examples Expand file tree Collapse file tree 2 files changed +316
-31
lines changed Original file line number Diff line number Diff line change @@ -83,25 +83,40 @@ workflows:
8383
8484## Path Transformations
8585
86+ Path transformations are used with **` glob`** and **`regex`** transformation types using the `transform` parameter.
87+
8688# ## Built-in Variables
8789- ` ${path}` - Full source path
8890- ` ${filename}` - File name only
8991- ` ${dir}` - Directory path
9092- ` ${ext}` - File extension
93+ - ` ${relative_path}` - Path relative to glob pattern prefix (glob only)
9194
92- # ## Examples
95+ # ## Glob Transformation Examples
9396` ` ` yaml
9497# Keep same path
95- path_transform: "${path}"
98+ transformations:
99+ - glob:
100+ pattern: "examples/**/*.go"
101+ transform: "${path}"
96102
97103# Change directory
98- path_transform: "docs/${path}"
104+ transformations:
105+ - glob:
106+ pattern: "examples/**/*.go"
107+ transform: "docs/${relative_path}"
99108
100- # Reorganize structure
101- path_transform: "docs/${lang}/${category}/${filename}"
109+ # Reorganize structure (using custom variables from regex)
110+ transformations:
111+ - regex:
112+ pattern: "^examples/(?P<lang>[^/]+)/(?P<category>[^/]+)/(?P<file>.+)$"
113+ transform: "docs/${lang}/${category}/${file}"
102114
103115# Change extension
104- path_transform: "${dir}/${filename}.md"
116+ transformations:
117+ - glob:
118+ pattern: "examples/**/*.txt"
119+ transform: "${dir}/${filename}.md"
105120` ` `
106121
107122# # Commit Strategies
You can’t perform that action at this time.
0 commit comments