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

fix: add anonymous crossoriginto fontawesome fonts #1634

Closed
wants to merge 1 commit into from

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented Jan 6, 2024

Fix #1613

@dbitouze I'm in unknown territory here so you should consider this PR experimental.
I think the issue is relater to the definition of the links so I tried setting up more details in the webpack.config.js

Could you try your build against this PR version and let us know ?

@dbitouze
Copy link
Contributor

dbitouze commented Jan 6, 2024

@12rambau As asked here, how to proceed to test a branch or a PR (in concrete terms)? 😉

@12rambau
Copy link
Collaborator Author

12rambau commented Jan 6, 2024

To test a build against a branch you need to install the lib using the git reference. Somwhere in your requirements.txt, setup.py or pyproject.toml you should have a line like:
pydata-sphinx-theme>=0.14.4

replace this line with the PR url as such:
pydata-sphinx-theme @ git+https://github.com/12rambau/pydata-sphinx-theme@fontawesome

and you will be using this exact branch instead of the one published on pypi

@dbitouze
Copy link
Contributor

dbitouze commented Jan 7, 2024

(Sorry for the delay.) In fact don't have any requirements.txt, setup.py or pyproject.toml. Instead I tried to follow this procedure:

pip install git+https://github.com/12rambau/pydata-sphinx-theme@fontawesome

It looks it was properly installed but I couldn't find any webpack.config.js file (that you changed) in ./.venv/lib/python3.10/site-packages/pydata_sphinx_theme/. Anyway, still:

A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
A preload for '<URL>' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-brands-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-regular-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-solid-900.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-brands-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-solid-900.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-regular-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-solid-900.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-brands-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
index.html:339 A preload for 'file:///home/bitouze/latex/gutenberg/generation-de-la-faq-sous-sphinx/faq-md/_build/html/_static/vendor/fontawesome/6.5.1/webfonts/fa-regular-400.woff2' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

in Chromium-browser.

@dbitouze
Copy link
Contributor

dbitouze commented Jan 7, 2024

BTW, during the first .venv/bin/sphinx-build -v . _build/html process, I got the several warnings and errors: see
warnings_and_errors.txt.

@12rambau
Copy link
Collaborator Author

12rambau commented Jan 7, 2024

all the warnings you get are unrelated to the theme and due to issues with autosummary and I guess, API generation. let's focus on the subject at hand for the moment.

@12rambau
Copy link
Collaborator Author

12rambau commented Jan 7, 2024

(Sorry for the delay.) In fact don't have any requirements.txt, setup.py or pyproject.toml. Instead I tried to follow this procedure:

it's perfectly fine as well

It looks it was properly installed but I couldn't find any webpack.config.js file (that you changed) in ./.venv/lib/python3.10/site-packages/pydata_sphinx_theme/

That's normal the file is not distributed in the wheel it's simply used to dynamically build static resources upon installation.

If you inspect one of these links in the header of the generated header, does it have the crossorigin="" option or crossorigin="anonymous" ?

@dbitouze
Copy link
Contributor

dbitouze commented Jan 7, 2024

If you inspect one of these links in the header of the generated header, does it have the crossorigin="" option or crossorigin="anonymous" ?

The 3 links involved have crossorigin="anonymous".

@12rambau
Copy link
Collaborator Author

12rambau commented Jan 7, 2024

ok great so my change is propagated to the version you install bu still don't fix your issue....

@trallard
Copy link
Collaborator

This was already fixed in another PR so will close this one. Thanks for your work @12rambau 🙏🏽

@trallard trallard closed this Sep 27, 2024
@12rambau 12rambau deleted the fontawesome branch September 30, 2024 07:56
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.

Fontawesome warnings: “preload” and “crossorigin attribute”
3 participants