-
-
Notifications
You must be signed in to change notification settings - Fork 573
Closed
Labels
converted-to-discussionenhancementfeature: CLIRelated to command line flags/usage/featuresRelated to command line flags/usage/featuresfeature: π data cascadeIssues related to the Data Cascade featureIssues related to the Data Cascade feature
Description
Is your feature request related to a problem? Please describe.
I am running eleventy in development and from netlify. I'd like the ability to inject some data from the environment into my templates.
Describe the solution you'd like
A command line option to the eleventy command to either specify a file with data (json/js/etc) or specify k/v pairs on the command line.
e.g. eleventy --data baseUrl=$DEPLOY_PRIMEURL
Describe alternatives you've considered
Here's how I worked around it with javascript data in a file I called _data/site.json:
module.exports = function() {
return new Promise((resolve, reject) => {
var url = process.env.CONTEXT == 'production' ?
process.env.URL :
process.env.DEPLOY_PRIME_URL;
resolve({
"baseUrl": url || "http://localhost:8080"
});
});
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
converted-to-discussionenhancementfeature: CLIRelated to command line flags/usage/featuresRelated to command line flags/usage/featuresfeature: π data cascadeIssues related to the Data Cascade featureIssues related to the Data Cascade feature