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
Google Fonts CSS API update #1714
Comments
I am also interested in this feature, but we have to be careful and not break the compatibility with existing sites. If the CSS API V2 is compatible with the first version, then just adding the "2" in the URL is OK, but I am not sure that the CSS API V2 is compatible with V1 One option could be with another variable (e.g.
Note : I would leave the Another option could be to "inspect" the content of the variable and choose the appropriate URL. We could, for example, decide that if the variable starts with "family=", then we use the CSS API V2, otherwise we keep the V1. Something like this (NOT TESTED)
I would be happy to contribute with a tested PR if you agree. |
@rodrigoalcarazdelaosa thanks for the heads up on Google's new API version. The solution is perhaps not that trivial (the Google docs refer to other changes) and there's also the consideration @supcik mentioned of breaking existing sites. Feel free to open a PR for the community to comment on and review :) |
Feature Request
Is your feature request related to a problem? Please describe.
No, but with this update variable fonts are supported, and it's the default link for Google Fonts now.
Describe the solution you'd like
Update the link when embedding Google Fonts according to this guide. It seems the only change is using
css2
instead ofcss
.Line 120 of the
/layouts/partials/site-head.html
file:<link rel="stylesheet" {{ printf "href=\"https://fonts.googleapis.com/css?family=%s&display=swap\"" . | replaceRE "\\|" "%7C" | safeHTMLAttr }}>
Describe alternatives you've consideredAdditional contextThe text was updated successfully, but these errors were encountered: