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

Serve google fonts locally #19

Merged

Conversation

Finn10111
Copy link
Contributor

Some people may have privacy concerns if the Google fonts are loaded from Google's servers. I downloaded the used fonts and added them to the theme so they are served locally now. This should be GDPR compliant now.

What do you think? I know it's "common" to use fonts.googleapis.com but I am not a big fan of this instead. I was thinking to do this within a child theme but this seemed to be the better approach.

@Finn10111 Finn10111 changed the title Serve google fonts local Serve google fonts locally Jun 20, 2023
@pmoreno-rodriguez pmoreno-rodriguez self-assigned this Jun 21, 2023
@pmoreno-rodriguez pmoreno-rodriguez added the enhancement New feature or request label Jun 21, 2023
@pmoreno-rodriguez
Copy link
Owner

Hi @Finn10111

I'll take a look at your suggestion. I'm thinking it would be a good idea to give users two options: one is to load google fonts from the internet and the other is to load from a local file.

what do you think about it?

@Finn10111
Copy link
Contributor Author

Yes you are right, some people prefer fonts.googleapis.com because of caching and other reasons. But I have to admin that I don't have a lot of experience with Grav and I am not sure how to do that. If you could give me a hint I would like to have dig deeper to find that kind of solution.

@Finn10111
Copy link
Contributor Author

Thanks for your suggestion, this one works for me now. But I don't know if it's the way to go.

Updated to include all original Google fonts in Editorial Theme
Copy link
Owner

@pmoreno-rodriguez pmoreno-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated google-fonts-local.css to include all original google fonts in the editorial theme and reordered the theme blueprint to show the option to choose google fonts before the header section.

Added Spanish traslations
Reordered option in theme options, not in header.
@pmoreno-rodriguez
Copy link
Owner

HI @Finn10111 Is the google-font.css file really necessary? So far you have uploaded two css style sheets for google fonts, the first with -local.css and the second with -remote.css

@pmoreno-rodriguez pmoreno-rodriguez merged commit 28e38c3 into pmoreno-rodriguez:develop Jul 2, 2023
@Finn10111
Copy link
Contributor Author

@pmoreno-rodriguez I didn't know how to choose between the local or remote Google Fonts so I put them in two css style sheets and put the logic in the template, I hope this was okay.

@pmoreno-rodriguez
Copy link
Owner

@Finn10111 I was referring to a third file called google-fonts.css. In your pull-request you have used two files, one ending in -local.css and the other in -remote.css.

However, it is already included in the new version of the Editorial theme.

For the next version I would like to count on your help and extend the local Google fonts file, to the rest of the encodings that are included in the original (Cyrillic, Vietnamese, Greek, etc.). Currently only the Latin encoding is included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants