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!
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!