Add support for base just as well as site const { generator, site, base } = Astro
#845
Closed
Jean-Baptiste-Lasselle
started this conversation in
Proposal
Replies: 2 comments 4 replies
-
I agree it’s a little confusing that this is not in |
Beta Was this translation helpful? Give feedback.
4 replies
-
You can access this data through the new |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
Support for base as well as site in the global Astro
I here propose to extend the
Astro
global, so that the following will properly compile, and bothsite
andbase
set inastro.config.mjs
are accessible in the same fashion, in*.astro
files, like this :Background & Motivation
I experienced an error in my codebase, while i was trying to access the value of base, which i set from environment variable, for my astro build.
being able to set from environment variable the
base
, is something which i thinkmany dev teams would think of doing, and then they would want to have access to that value as gracefully as possible in the*.astro
files.see As of withastro/astro#10007 (comment) , for the full story.
Goals
The goal is to be able to access the value of
base
set in theastro.config.mjs
, just as well as we do with thesite
config param.Example
Beta Was this translation helpful? Give feedback.
All reactions