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

Unresolving fonts in static WordPress pull #31

Closed
nathanfletcher opened this issue Jul 9, 2021 · 5 comments · Fixed by #37
Closed

Unresolving fonts in static WordPress pull #31

nathanfletcher opened this issue Jul 9, 2021 · 5 comments · Fixed by #37
Assignees
Labels
bug Something isn't working

Comments

@nathanfletcher
Copy link
Collaborator

After the script pulls the WordPress sites pages, part of the subsequent steps is to build packages/eligibility
That throws the following error in the build process

Error: Can't resolve '/wp-content/themes/dpga/font/NowAlt-Regular.woff' in '/home/runner/work/publicgoods-scripts/publicgoods-scripts/packages/eligibility/src'```
@nathanfletcher nathanfletcher added the bug Something isn't working label Jul 9, 2021
@nathanfletcher nathanfletcher self-assigned this Jul 9, 2021
@nathanfletcher
Copy link
Collaborator Author

This is the sandbox I'm fixing it and other minor bugs found
https://github.com/nathanfletcher/publicgoods-scripts

@lacabra
Copy link
Contributor

lacabra commented Jul 9, 2021

@nathanfletcher This may be a "non-consequential" error, that may require further investigation. For example, why is it that the error does not appear in the build that the CI does here? (if it appeared, it would error out)

Can you please provide additional information on how this error is triggered?

@nathanfletcher
Copy link
Collaborator Author

@lacabra Creating a GitHub action in this repo to set up the CI in this repo to run npm run build in both folders packages/registry and packages/eligibility means that all the steps from 1-8 in the Readme would have to be followed first, with some slight modifications to include packages/registry and packages/eligibility.

Running npm run build for packages/eligibility after the steps throws this error because it cannot find /wp-content/themes/dpga/font/NowAlt-Regular.woff as the CSS is not able to access folders outside the src folder of packages/eligibility during the npm run build process.

I solved it by including a step in moveFiles.bash here to copy the fonts folder from the static wp-content into packages/eligibility and updated the links to the fonts in the CSS.
That way it won't worry the upstream build command here

@nathanfletcher
Copy link
Collaborator Author

nathanfletcher commented Jul 10, 2021

@lacabra Alternatively, a simpler solution would be for @rachita19082 to include the fonts folder with the respective fonts in the project.
That is if the fonts used would not change anytime soon so the current solution I have above wouldn't have to pull it from the static WordPress here

@lacabra
Copy link
Contributor

lacabra commented Jul 14, 2021

@nathanfletcher I prefer your solution of copying them only for the purposes of the CI. Alternatively, you could do a soft link of the relative folder (because you have it cloned already -> that's how I have it in my local environment, and works well)

For sure, do not include the fonts in the source code because they don't belong there, and introduces undesired redundancy.

Thanks!

@nathanfletcher nathanfletcher linked a pull request Jul 21, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants