fix: fonts fail to load on www subdomain (resolves #2006) #2063
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2006
The fonts.css file is generated when
php artisan google-fonts:fetch
is called. It is configured to use thepublic
disc which had been setup to include theAPP_URL
to generate an absolute URL to the resource. However, because this is configured to be the URL without the sub domain, it produces the wrong URL when the www subdomain is used. To resolve the issue, a URL relative to the root is used instead.This can be tested locally by adding the www subdomain in front. For example if configured to run on
platform.test
you can usewww.platform.test
. This works with Herd at least, so may depend on your local setup.Prerequisites
If this PR changes PHP code or dependencies:
composer format
and fixed any code formatting issues.composer analyze
and addressed any static analysis issues.php artisan test
and ensured that all tests pass.composer localize
to update localization source files and committed any changes.If this PR changes CSS or JavaScript code or dependencies:
npm run lint
and fixed any linting issues.npm run build
and ensured that CSS and JavaScript assets can be compiled.