-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add SvelteKit as an option for static_site_generator setting #16
Conversation
I doubt that |
This is actually something I had added in #15 (which is now merged) as well. 😊 👍🏻 Unfortunately, that means some merge conflicts here. 😅 |
99a18c9
to
4e3737e
Compare
No worries, I just rebased on those changes. I also did add the |
…d SvelteKit code Co-authored-by: NatoBoram <natoboram@users.noreply.github.com>
8d1c0e5
to
4245166
Compare
I just re-read some comments and I noticed that @yoannchaudet considers
Maybe we shouldn't put it in |
I see what you mean about his comment, but in my opinion exporting such a general variable in SvelteKit only configuration is a brittle solution that breaks ownership principles. I see two specific flaws with it. First, people may end up wanting to use the variable in other configurations since it's so general, and it has to be moved (or people may forget about it). Second, the method it would be placed in should only handle configuration setup, and giving it another task of setting the environment variable would be confusing. I do agree that making this sveltekit only could have it get merged faster, but it's hard to tell because I don't think we've really done any convincing. I just gave you collaborator access to my repo if you want to move it, but I'd suggest moving it to a separate, environment variable setup function similar to config setup that checks for SvelteKit. |
src/index.js
Outdated
@@ -18,6 +18,7 @@ async function main() { | |||
setPagesPath({ staticSiteGenerator, generatorConfigFile, path: siteUrl.pathname }) | |||
} | |||
outputPagesBaseUrl(siteUrl) | |||
core.exportVariable('GITHUB_PAGES', true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had the discussion with the team and we are fine having a global environment variable exposed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me. @JamesMGreene opinion :)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, minus one nit about the data type of the environment variable export. 👍🏻
This is now released in You can use it with any of the following uses: actions/configure-pages@f71d3d08f0abfe9cbb23e527dc9f633beabf97bc
uses: actions/configure-pages@v1.2.0
uses: actions/configure-pages@v1
uses: actions/configure-pages@main Thank you for the contribution! 💝 |
Add SvelteKit as an option for use as a static site generator.
I had set up the config parsing changes earlier today, but I added the actual SvelteKit config code more recently based on @NatoBoram's snippet. In the snippet, he provided an example for setting a
GITHUB_PAGES
environment variable, which has been discussed in the same thread. I didn't include this just yet, as I might suggest moving it outside of the SvelteKit SSG option into a more global spot, since it may not be SvelteKit specific. This all depends on the outcome of the thread, though.