This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Is it possible to use environment variables in context? #72
Milestone
Comments
You could probably write a simple template tag that looked at https://github.com/thanethomson/statik/wiki/Custom-template-tags-and-filters |
Oh that's a good idea. I'll look into it. |
So in general this works, but the flow is not that smooth. Some native support would still be nice. Maybe just a command line switch to specify which config file to pick instead of defaulting to |
You can already specify a different config file from the command line just using the > statik -p my-custom-config.yml |
kx-chen
added a commit
to kx-chen/statik
that referenced
this issue
Dec 6, 2018
Add environment variables to context so they may be used in views. Closes thanethomson#72
kx-chen
added a commit
to kx-chen/statik
that referenced
this issue
Dec 6, 2018
Add environment variables to context so they may be used in views. Closes thanethomson#72
kx-chen
added a commit
to kx-chen/statik
that referenced
this issue
Dec 6, 2018
Add environment variables to context so they may be used in views. Closes thanethomson#72
kx-chen
added a commit
to kx-chen/statik
that referenced
this issue
Dec 6, 2018
Add environment variables to context so they may be used in views. Closes thanethomson#72
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is it possible to use environment variables (or some other type of configuration) in context variables?
The use case is the following - I have a static site with an external analytics service enabled. I'd like statik to include the analytics JS snippet only when building for deployment, not in development. If statik had the concept of development/production modes, this would be possible. Alternatively, some form of templating in the YAML config files would also help.
Is this currently possible somehow? If not, what should the ideal interface here look like? If the change is not too big, I could think about submitting a PR.
Statik is very cool btw. Thanks for writing it. I feel this is a static site generator that's done "right".
The text was updated successfully, but these errors were encountered: