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

[BUGFIX-37] Relative urls with a harcoded contextPath #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

davorpa
Copy link
Member

@davorpa davorpa commented Sep 16, 2022

What does this PR do?

Add feature(s) | Fix

Description

Allow install app in other context path different to /free-programming-books-search to increase flexibility

Context

Resolves #37

Test deploy: https://davorpa.github.io/free-programming-books-search/ Check:

  • H1 link goes to homepage /free-programming-books-search/
  • Any link in homepage goes to it related file (docs or listings)
  • No extra ampersand in them before sect parameter

@davorpa davorpa changed the title extract hardcoded contextPath to a constant [BUGFIX-37] Relative urls with a harcoded contextPath Sep 16, 2022
@eshellman
Copy link
Contributor

is this to make it easier to test?

@davorpa
Copy link
Member Author

davorpa commented Sep 18, 2022

is this to make it easier to test?

Sorry sir 😟. Not sure at all until deploy (execute npm run deploy from a cmd) with a production build

In local development works but in github.io I don't know because my environment is broken. I doubt if after apply this PR the context path is / or /free-programming-books-search

Maybe it lefts to add a .env.production file to force values for this build profile according to https://create-react-app.dev/docs/adding-custom-environment-variables#adding-development-environment-variables-in-env

A revert is always possible in the worst of cases

How to test if works...

image

@davorpa
Copy link
Member Author

davorpa commented Sep 18, 2022

Fresh news after fix my deploy environment

It works like expected. https://davorpa.github.io/free-programming-books-search/ without any .env file. Maybe due to package.json homepage attribute is setted.

  • H1 link goes to homepage /free-programming-books-search/
  • Any link in homepage goes to it related file (docs or listings)
  • No extra ampersand in them before sect parameter

If you want be sure at local you always checkout this PR make a build and... follow steps posted in #39

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.

There are some relative urls with a harcoded contextPath
2 participants