Skip to content
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

Support arbitrary path prefix #358

Merged
merged 28 commits into from
Mar 28, 2023
Merged

Support arbitrary path prefix #358

merged 28 commits into from
Mar 28, 2023

Conversation

afischer
Copy link
Member

Replaces #334 as I can't make edits to the newsguild branch.

Description of Change

Library currently expects to be hosted at the root of its domain. However, it can be valuable to host it at a subpath (e.g. mydomain.org/library).

This PR introduces a new environment variable, PATH_PREFIX, which defaults to '/', and formats all internal URLs with that path prefix.

In order to pipe the environment variable through everywhere it needed to go, I had to touch almost every file. If it turns out that there's a cleaner way to do this, please let me know!

This feature is being used live for the NYT Tech Guild's Library site.

This PR also bumps Library up to Node 16; it's currently configured for 10, which is unsupported!

@afischer afischer changed the title Newsguildny clean Support arbitrary path prefix Mar 27, 2023
@afischer afischer mentioned this pull request Mar 27, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants