From acb3b83db78fe602f562bcf0fb5b7a026c4970ac Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 18 Apr 2024 12:17:01 -0500 Subject: [PATCH] Feedback from code review. --- vignettes/customise.Rmd | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/vignettes/customise.Rmd b/vignettes/customise.Rmd index f416a5e78..c7118c2a0 100644 --- a/vignettes/customise.Rmd +++ b/vignettes/customise.Rmd @@ -125,7 +125,7 @@ template: If you want to use a non-Google font, you'll need to do a bit more work. There are two steps: you need to first configure the font with CSS and then use it in your `_pkgdown.yaml`. There are two ways you might get the CSS: -* As a block of CSS which you should put in `pkgdown/extra.css`. The CSS will look something like this: +* As a block of CSS which you should put in `pkgdown/extra.scss` or `pkgdown/extra.css`. The CSS will look something like this: ```css @font-face { @@ -133,10 +133,10 @@ If you want to use a non-Google font, you'll need to do a bit more work. There a src: local("Proxima Nova Regular"), local("ProximaNova-Regular"), - url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.eot?#iefix") format("embedded-opentype"), - url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.woff2") format("woff2"), - url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.woff") format("woff"), - url("https://ropensci.org/fonts/proxima/ProximaNova-Regular.ttf") format("truetype"); + url("https://example.com/ProximaNova-Regular.eot?#iefix") format("embedded-opentype"), + url("https://example.com/fonts/proxima/ProximaNova-Regular.woff2") format("woff2"), + url("https://example.com/fonts/proxima/ProximaNova-Regular.woff") format("woff"), + url("https://example.com/fonts/proxima/ProximaNova-Regular.ttf") format("truetype"); font-weight: normal; font-style: normal; font-display: fallback; @@ -159,7 +159,9 @@ template: base_font: proxima-nova ``` -When iterating on fonts, you'll need to run `build_home_index(); init_site()` then refresh you browwser to see the update. +Depending on where the font is from (and if you paid money for it), you may need to take additional steps to ensure that it can only be used from your site, and/or make sure that it can still be used when you're previewing locally. If you're having problems getting a custom font to work, looking for errors in the browser developer console is a good place to start. + +When iterating on fonts, you'll need to run `build_home_index(); init_site()` then refresh you browser to see the update. ### Syntax highlighting