-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to currently running domain #965
Comments
Where do you need this? On the client side? Build process? Or in the development server with browsersync? You can grab some useful information from regular ol' DOM APIs on client side. Here's a SO post about getting the host url from the DOM that might be useful. |
I was imagining server-side. It's definitely available client-side. |
Have you considered something like path-prefix or some kind of global data variable that you can set at build time? Since Eleventy is an SSG, it's not going to generate server responses like server-side rendering might. This seems like something you could do with a command or env variable at build time. |
Right, it can be done now. I definitely acknowledge that. And I know it would only be available at build time, ie it wouldn't be dynamic in the build results. I'm just saying it could be handy to be able to access these values. |
I’m a bit confused what this means? I understand that you’d want to find the |
I had imagined we could have access to something like a request object, but... yeah. The more I think about this the more I feel like it's not a good idea. My attempt here was to help out SO questioner (https://stackoverflow.com/questions/60309000/generating-full-urls-on-eleventy-and-netlify/60401857?noredirect=1#comment106866809_60401857), but I think we can do without. Thanks for hearing me out! |
Thinking about it … |
While we have access to env variables, it would be nice if we could get access to domain specific values like the current running host and port. While you can get by without this using env variables (if env === 'prod' then my url must be foo.com), I think it could still be useful to have access to.
The text was updated successfully, but these errors were encountered: