Using function like things in templates #2947
danielo515
started this conversation in
Show and tell
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Today I had a conversation with chat-gpt to update one of my chezmoi templates. I'm not good at templating and I wanted it to do it fast. I asked it to add some comments to the generated file so I can see where each section is coming from in the generated file. Because I had some conditionals, it duplicated the comment in several places. When I asked it if there is a way to avoid the duplication, to my surprise it suggested to use the define directive and created a simple include block with comments. I searched the docs and I didn't find anything mentoning this, but it works, so I want to share it here:
Beta Was this translation helpful? Give feedback.
All reactions