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

Hosting files instead of using cdn #2047

Closed
JerryWho opened this issue Feb 19, 2022 · 7 comments
Closed

Hosting files instead of using cdn #2047

JerryWho opened this issue Feb 19, 2022 · 7 comments
Labels
reprex needs a minimal reproducible example

Comments

@JerryWho
Copy link

In Germany using Google fonts is not allowed anymore without consent of the user because of GDPR. (see German news at https://www.golem.de/news/landgericht-muenchen-einbindung-von-google-fonts-ist-rechtswidrig-2202-162826.html)
It is expected that any other use of cdns will be a problem, too.

So it would be great that we could switch to own hosting of the files currently hosted on cdns.

@jayhesselberth
Copy link
Collaborator

You can include local JS files using e.g. pkgdown/assets/local.js and refer to them using:

template:
  includes:
    in_header:
      <script src="local.js"></script>

https://pkgdown.r-lib.org/dev/articles/customise.html?q=extra.js#additional-html-and-files

@maelle
Copy link
Collaborator

maelle commented Feb 21, 2022

Interesting 👀

This is also related to #1968

Two examples of templates that do not use Google fonts

For other CDN, you might want to look into custom head templates https://pkgdown.r-lib.org/articles/customise.html#additional-html-and-files

@JerryWho
Copy link
Author

Adding custom js-files won’t solve the problem. As I understand the docs the additional code is added. So cdn-files are still there.
Creating a custom template without any cdn files would solve the problem. It would be nice if this template is part of pkgdown and can be used by just setting the right switch on creating the site.

@hadley
Copy link
Member

hadley commented May 31, 2022

@JerryWho precisely what fonts are you talking about? Perhaps I'm missing something, but I don't see any sign that (e.g.) https://pkgdown.r-lib.org is downloading fonts from google. And in font_google(), localdefaults toTRUE` which I think implies that in most cases any external google fonts will be downloaded and served from your site.

@hadley hadley added the reprex needs a minimal reproducible example label May 31, 2022
@JerryWho
Copy link
Author

JerryWho commented Jun 2, 2022

@hadley Google Fonts were just the trigger for a verdict in Germany. But it is expected that any files loaded from cdns need consent by the user.

So I'm looking for a solution to host all files (such as js, css etc) locally and not being hosted by a cdn.

@maelle
Copy link
Collaborator

maelle commented Jun 2, 2022

Is #2099 relevant?

@JerryWho
Copy link
Author

JerryWho commented Jun 2, 2022

Is #2099 relevant?
Yes, you are right. That’s exactly what I’m looking for.

@hadley hadley closed this as completed Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

4 participants