Skip to content

Process datasources as templates before the final template #2151

Closed Answered by hairyhenderson
tiawl asked this question in Q&A
Discussion options

You must be logged in to vote

Are you trying to use the nested template itself as a datasource? I'm a bit confused about that...

One thing you may want to also look at is the tmpl.Exec function - see https://docs.gomplate.ca/functions/tmpl/#tmplexec

And re: the environment variables - template doesn't inherit the context unless you explicitly tell it to - like {{ template "user" . }}.

But perhaps a cleaner approach would be to use getenv instead

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@tiawl
Comment options

@tiawl
Comment options

@hairyhenderson
Comment options

Answer selected by tiawl
@tiawl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2136 on June 28, 2024 17:21.