mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 06:29:03 +02:00
We look for fonts object within siteConfig.js
This commit is contained in:
parent
e0704d0f55
commit
a241a46669
3 changed files with 38 additions and 1 deletions
lib/server
|
@ -487,6 +487,18 @@ function execute(port) {
|
|||
.string();
|
||||
cssContent = cssContent.replace(new RegExp('\\$codeColor', 'g'), codeColor);
|
||||
|
||||
if (siteConfig.fonts) {
|
||||
Object.keys(siteConfig.fonts).forEach(key => {
|
||||
const fontString = siteConfig.fonts[key]
|
||||
.map(font => '"' + font + '"')
|
||||
.join(', ');
|
||||
cssContent = cssContent.replace(
|
||||
new RegExp('\\$' + key, 'g'),
|
||||
fontString
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
res.send(cssContent);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue