-
Notifications
You must be signed in to change notification settings - Fork 100
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
Update fonts #111
Update fonts #111
Conversation
✅ Deploy Preview for nginx-unit ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
LGTM once the new woff2's are committed, thank you! Your commit message is missing its closing In the future, it could be neat to ship a single variable font of Open Sans, but not worth the effort for the moment. |
Actually add the fonts
|
Tweak commit message
|
I'm not actually seeing the fonts in the deploy preview; the woff2's are 404'ing it's falling back to Arial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The font URLs should point to _static/
, not static/
:)
Expand the commit message a little regarding WOFF vs WOFF2
|
|
Fix font paths
|
During build, static files get collected into You can drop the relative bits and use |
OK, I'll try that because this is giving me a 404...
|
Update font paths again...
|
That's working! Woo! Looking at the diff one more time, I noticed that we were using a helper function for building paths (and appending hashes for cache-busting). If we want to follow precedent: diff --git a/source/theme/layout.html b/source/theme/layout.html
index 3bd369a..27d2797 100644
--- a/source/theme/layout.html
+++ b/source/theme/layout.html
@@ -37,7 +37,7 @@
font-style: normal;
font-weight: 400;
src: local('OpenSans'), local('Open Sans'), local('Open Sans Regular'), local('OpenSans-Regular'),
- url('/_static/open-sans-v40-latin_latin-ext-regular.woff2') format('woff2');
+ url('{{ pathto('/_static/open-sans-v40-latin_latin-ext-regular.woff2', 1) + '?' + md5('theme/static/open-sans-v40-latin_latin-ext-regular.woff2') }}') format('woff2');
}
/* open-sans-italic - latin_latin-ext */
@@ -47,7 +47,7 @@
font-style: italic;
font-weight: 400;
src: local('OpenSansItalic'), local('Open Sans Italic'), local('OpenSans Italic'), local('OpenSans-Italic'),
- url('/_static/open-sans-v40-latin_latin-ext-italic.woff2') format('woff2');
+ url('{{ pathto('/_static/open-sans-v40-latin_latin-ext-italic.woff2', 1) + '?' + md5('theme/static/open-sans-v40-latin_latin-ext-italic.woff2') }}') format('woff2');
}
/* open-sans-700 - latin_latin-ext */
@@ -57,7 +57,7 @@
font-style: normal;
font-weight: 700;
src: local('OpenSansBold'), local('Open Sans Bold'), local('OpenSans Bold'), local('OpenSans-Bold'),
- url('/_static/open-sans-v40-latin_latin-ext-700.woff2') format('woff2');
+ url('{{ pathto('/_static/open-sans-v40-latin_latin-ext-700.woff2', 1) + '?' + md5('theme/static/open-sans-v40-latin_latin-ext-700.woff2') }}') format('woff2');
}
/* open-sans-700italic - latin_latin-ext */
@@ -67,7 +67,7 @@
font-style: italic;
font-weight: 700;
src: local('OpenSansBoldItalic'), local('Open Sans Bold Italic'), local('OpenSans Bold Italic'), local('OpenSans-BoldItalic'), local('OpenSans-Bold-Italic'),
- url('/_static/open-sans-v40-latin_latin-ext-700italic.woff2') format('woff2');
+ url('{{ pathto('/_static/open-sans-v40-latin_latin-ext-700italic.woff2', 1) + '?' + md5('theme/static/open-sans-v40-latin_latin-ext-700italic.woff2') }}') format('woff2');
}
</style> |
I'll see if it still works with your change... |
Yeah it works... |
Use the css pathto magic + md5 sum as before
|
Update the bundled Open Sans fonts using <https://gwfh.mranftl.com/fonts/open-sans?subsets=latin,latin-ext> These include Regular and Italic and Bold (700) and Bold (700) Italic for the latin and latin extended character sets. This removes the older WOFF format font and we now only use WOFF2 fonts. WOFF2 offers better compression amongst other things. It is supported by all modern browsers... Edge (since version 14) Google Chrome (since version 36) Firefox (since version 35) Opera (since version 26) Safari (since version 10) Closes: nginx#109 Reviewed-by: Dan Callahan <d.callahan@f5.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Add Dan's Reviewed-by
|
Update the bundled Open Sans fonts from
https://gwfh.mranftl.com/fonts/open-sans?subsets=latin,latin-ext
These includes Regular and Italic and Bold (700) and Bold (700) Italic for the latin and latin extended character sets.